I'm fairly sure the set code should look like this:
function setPYR(float pitch, float yaw, float roll) {
glLoadIdentity();
glRotatef(pitch, 1, 0, 0);
glRotatef(yaw, 0, 1, 0);
glR开发者_如何学Gootatef(roll, 0, 0, 1);
}
How can I get the pitch, yaw and roll from the current modelview matrix?
Give a look at The Matrix and Quaternions FAQ.
精彩评论