Direction of rotation or handedness in three.js

依然范特西╮ 提交于 2019-12-24 02:07:07

问题


I've noticed that when I rotate my model around the Z axis, like this:

model.rotateZ(rotatedAngle * Math.PI / 180);

it seems to rotate counter-clockwise around the axis.

  • Is this observation accurate?
  • Is this documented somewhere? I couldn't find it, perhaps I'm using the wrong search terms.
  • Is this configurable?
  • Most importantly what is the best practice for managing rotations?

回答1:


Three.js uses the right handed system and this means counter clockwise is default rotation. See here for all rotation rules...

Left the left handed system (clockwise), right the right handed system (counter clockwise)

So then adding something to your angle rotates counter clockwise and removing something rotates clockwise.

function rotate(){
    mesh1.rotation.z += 0.01;  // rotates counter clockwise
    mesh2.rotation.z -= 0.01;  // rotates clockwise
}

A Fiddle here to demonstrate



来源:https://stackoverflow.com/questions/35495872/direction-of-rotation-or-handedness-in-three-js

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