Olie
Olie

Reputation: 24675

What's the counterpart to glGetMatrix() (and why isn't glSetMatrix() it?!!!)?

Ok, I've been convinced that quaternions are The Way To Go, rather than trying to make pitch, yaw, roll rotations work out. So now I've got code that looks something like this (obj-C, but it shouldn't matter):

[quaternion makeIdentity];
[quaternion setPitch: rotation.x yaw: rotation.y roll: rotation.z];

GLfloat matrix[16];
[quaternion stuffMatrix: &matrix];
matrix[12] = location.x;
matrix[13] = location.y;
matrix[14] = location.z;
// Now what?
// glSetMatrix(matrix); //  No, that's not right, is it?!

Once I've set my quaternion to deal with the various rotations and stuffed the values into my matrix array, how do I set the current matrix to those values?

Thanks!

P.S. Yes, I'm an Open-GL n00b. Sorry if this is basic stuff; I just can't seem to find it in the docs.

Upvotes: 1

Views: 2484

Answers (1)

Joshua Weinberg
Joshua Weinberg

Reputation: 28688

glPushMatrix or glLoadMatrix is what you're looking for

Upvotes: 6

Related Questions