I modified this single rotating cube so that it contains 3 cubes in Object3D
http://jsfiddle.net/VsWb9/1243/
In the above example, it uses the first cube. I need it to rotate on the same axis in the exact center of the object.
Code object3D
geometry = new THREE.CubeGeometry(50, 50, 50); material = new THREE.MeshNormalMaterial(); mesh = new THREE.Object3D(); mesh1 = new THREE.Mesh(geometry, material); mesh1.position.x = 50; mesh2 = new THREE.Mesh(geometry, material); mesh2.position.x = 100; mesh3 = new THREE.Mesh(geometry, material); mesh.add(mesh1); mesh.add(mesh2); mesh.add(mesh3); scene.add(mesh);
Here is the twist
mesh.rotation.x += 0.01; mesh.rotation.y += 0.02;
EDIT: just to say this is an example of a problem demonstration, my actual code object contains many different sizes.
source share