我需要将对象组的位置作为一个项目进行管理。
我有:
tankMesh1 = new THREE.Mesh(geometry, material);
tankMesh2 = new THREE.Mesh(geometry, material);
scene.add(tankMesh1);
scene.add(tankMesh2);
tankMesh2.position = tankMesh2.position + offset * cos ( angle )
我需要:
tankMeshBig = new THREE.Mesh(tankMesh1 , tankMesh2 );
答案 0 :(得分:1)
您可以使用新的THREE.Object3D()
:
JS:
var group=new THREE.Object3D();
tankMesh1 = new THREE.Mesh(geometry, material);
group.add(tankMesh1);
geometry = new THREE.CubeGeometry(3, 2, 5);
tankMesh2 = new THREE.Mesh(geometry, material);
tankMesh2.position.y = 3;
group.add(tankMesh2);
group.rotation.y = 3.141/3;
scene.add(group);