我试图将两个立方体添加到同一个组中并使它们相邻渲染。
var cube1 = new THREE.Mesh(new THREE.CubeGeometry(1,1,1), new THREE.MeshNormalMaterial());
var cube2 = new THREE.Mesh(new THREE.CubeGeometry(1,1,1), new THREE.MeshNormalMaterial());
cube1.position = new THREE.Vector3( 1, 0 , 0 );
cube2.position = new THREE.Vector3( 0, 1 , 0 );
var cubeGroup = new THREE.Group();
cubeGroup.add( cube1 );
cubeGroup.add( cube2 );
scene.add(cubeGroup);
输出似乎在同一位置显示两个立方体。
我在初始化期间通过沿正交组件拉伸它们来检查那些是两个不同的立方体...
var cube1 = new THREE.Mesh(new THREE.CubeGeometry(2,1,1), new THREE.MeshNormalMaterial());
var cube2 = new THREE.Mesh(new THREE.CubeGeometry(1,2,1), new THREE.MeshNormalMaterial());
结果是两个矩形棱镜沿着原点渲染/居中:
所以我的问题如下:
whats wrong and how do I make it work?
are groups used to compose meshes into single units?(I want to rotate many adjacent cubes along a central axis)
Do CubeGeometries operate on the same scale that vectors and positions operate on?