1

I am trying to rotate a cube 90 degrees on the Y axis, and then 90 degrees on the Z axis, but when I apply the rotation on the Z axis, it actually changes the angle only on the X axis.

This is my code:

glRotatef(90.0, 0.0, 1.0, 0.0);
glRotatef(90.0, 0.0, 0.0, 1.0);

What is the correct way to achieve the result I want - I.e. 90 degrees on Y and then 90 degrees on Z?

Is there a good tutorial that explains how to use glRotate() correctly with examples?

4

1 回答 1

0

做一次,但设置你想在一个函数中旋转的角度

glRotatef(90.0, 0.0, 1.0, 1.0);
于 2021-04-08T14:30:58.123 回答