Obb3 (Center、HalfVector、および axis[3]) が与えられた場合、
この Obb3 と同じ境界を持つキューブを作成するにはどうすればよいですか? 次に、この立方体を使用して obb3 境界を表示します。
vector_math と three.dart ライブラリを使用しています
。これまでのところ、私のコードは次のとおりです。
Matrix3 rot_mat = new Matrix3(node.box.axis0[0], node.box.axis1[0], node.box.axis2[0],
node.box.axis0[1], node.box.axis1[1], node.box.axis2[1],
node.box.axis0[2], node.box.axis1[2], node.box.axis2[2]);
Vector3 diag = rot_mat.absoluteRotate(node.box.halfExtents.clone());
var geometry = new CubeGeometry(diag[0] * 2.0, diag[1] * 2.0, diag[2] * 2.0);
var material = new MeshBasicMaterial(color: 0x00ff00,
wireframe: true,
blending: NormalBlending,
side: DoubleSide,
shading: FlatShading);
var obj = new Mesh(geometry, material);
obj.position = node.box.center;
obj.matrix.setRotation(rot_mat);
obj.updateMatrix();
scene.add(obj);
助けてくれてありがとう:]