0
メッシュ内のフェイスのワールド位置を取得する必要があります。これは私のコードです:親メッシュのスケーリング後の頂点のワールド位置の取得
var that = this,
addPoint,
geometry = mesh.geometry,
worldPos = mesh.getWorldPosition();
that.allMeshes[mesh.uuid] = {
mesh: mesh,
points: {}
};
addPoint = function (currPoint, face) {
var point = that.octree.add([worldPos.x + currPoint.x, worldPos.y + currPoint.y, worldPos.z + currPoint.z], {mesh: mesh, geometry: geometry, face: face});
that.allMeshes[mesh.uuid].points[point.id] = point;
};
geometry.faces.forEach(function(face) {
//Get the faces points cords
addPoint(geometry.vertices[face.a], face);
addPoint(geometry.vertices[face.b], face);
addPoint(geometry.vertices[face.c], face);
}, this);
親のメッシュがスケーリングされていない限り、これはすべてうまくいきます。誰もこれを解決する方法を知っていますか?
ルック:
ここで同様の質問があります。使用法: 'var worldVertex = yourMesh.localToWorld(yourMesh.geometry.vertices [i]);'。 [この回答](http://stackoverflow.com/questions/43265361/rotating-icosahedron-with-circles-located-at-every-vertex-in-three-js/43325479#43325479)にはいくつかの説明があります。 – TheJim01
ありがとうございます。 – arpo
はい、ありがとうございます。 – arpo