开发者

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?
// glS开发者_运维技巧etMatrix(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.


glPushMatrix or glLoadMatrix is what you're looking for

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜