0
当我在X轴上旋转相机时,如果Y旋转>或<大于0,它也旋转Z轴。
它为什么这样做?OpenGL - 不需要的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);
}
我想我知道是什么原因造成的,但我不那么肯定......
谢谢!我的代码现在看起来好多了。 – McDucky