开发者

Getting and Setting Pitch Yaw Roll from/to OpenGL modelview matrix

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜