My dilemma involves two box geometries:
var box;
loader.load( 'img/plytos.jpg', function ( texture ){
var boxGeometry = new THREE.BoxGeometry(7,0.5,0.5);
var boxMaterial = new THREE.MeshLambertMaterial({ map: texture, overdraw: 0.5 });
box = new THREE.Mesh(boxGeometry, boxMaterial);
box.castShadow = true;
box.position.x=15;
box.position.y=5;
box.position.z=2.7;
group.add(box);
var box;
loader.load( 'img/plytos.jpg', function ( texture ){
var boxGeometry = new THREE.BoxGeometry(7,7,0.5);
var boxMaterial = new THREE.MeshLambertMaterial({ map: texture, overdraw: 0.5 });
box = new THREE.Mesh(boxGeometry, boxMaterial);
box.castShadow = true;
box.position.x=15;
box.position.y=5;
box.position.z=2.7;
group.add(box);
Both boxes are part of a single group that is currently spinning:
group.rotation.y += ctrl.groupStep;
I want the entire group to continue spinning while also having the two box geometries rotate individually. I attempted adding this line next to the group rotation:
box.rotation.z += 0.02;
Unfortunately, only one box is rotating.
How can I make both boxes rotate simultaneously?