Rotation When Object is Spinning

545 Views Asked by At

[] []

Imagine those are the front tires of a car and they're spinning forward in a straight line. How would I rotate them (in a steering motion) without them being affected by their local (spinning) rotation?

1

There are 1 best solutions below

3
prisoner849 On BEST ANSWER

Add a "wheel" to a THREE.Group() object and rotate the group on y-axis.

  for(var i = 0; i < wheels.length; i++){
    steering[i].rotation.y = Math.sin(new Date() * 0.005) * 0.25;
    wheels[i].rotation.x += 0.1;
  }

each steering is a THREE.Group(), each wheels is a cylinder.

jsfiddle example