当我在 X 轴上旋转我的相机而 Y 旋转 > 或 < 小于 0 时,它也会旋转 Z 轴。
为什么这样做?
if(Keyboard.isKeyDown(Keyboard.KEY_UP)){
xRot-=speed_rotation;
glRotatef(-speed_rotation, 1, 0, 0);
}
if(Keyboard.isKeyDown(Keyboard.KEY_DOWN)){
xRot+=speed_rotation;
glRotatef(speed_rotation, 1, 0, 0);
}
if(Keyboard.isKeyDown(Keyboard.KEY_LEFT)){
yRot-=speed_rotation;
glRotatef(-speed_rotation, 0, 1, 0);
}
if(Keyboard.isKeyDown(Keyboard.KEY_RIGHT)){
yRot+=speed_rotation;
glRotatef(speed_rotation, 0, 1, 0);
}
我想我知道是什么原因造成的,但我不太确定......