opengl matrix rotation quaternions

后端 未结 4 960
忘掉有多难
忘掉有多难 2021-01-18 03:20

Im trying to do a simple rotation of a cube about the x and y axis:

I want to always rotate the cube over the x axis by an amount x and rotate the cube over the yax

4条回答
  •  梦毁少年i
    2021-01-18 03:57

    Your problem is not the gimbal lock. And effectively, there is no reason why your quaternion version would work better than your matrix (glRotate) version because the quaternions you are using are mathematically identical to your rotation matrices.

    If what you want is a mouse control, you probably want to check out arcballs.

提交回复
热议问题