user181351
user181351

Reputation:

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);
    glRotatef(roll, 0, 0, 1);
}

How can I get the pitch, yaw and roll from the current modelview matrix?

Upvotes: 2

Views: 4484

Answers (1)

tibur
tibur

Reputation: 11636

Give a look at The Matrix and Quaternions FAQ.

Upvotes: 1

Related Questions