Rotation When Object is Spinning

▼魔方 西西 提交于 2020-03-27 04:27:29

问题


[] []

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:


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



来源:https://stackoverflow.com/questions/40392156/rotation-when-object-is-spinning

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!