Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Quaternion / Transformation question

This topic is 6134 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

OK ... i''m using quaternions to represent my rotations (in a space sim). how do i use these in conjuction with forward momentum to obtain a new tranformation? i guess i translate everything from my position, and apply the rotation, to obtain the final modelview matrix. it''s the transformations i''m having trouble with!

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Matrix multiplications of the different transformations translations rotations etc... can all be combined into one step.

It is good programming style to have the matrix on top of the stack as the identity matrix. I.e. you should have


// always in the beginning of a program.


// to save the identity on the stack, faster than reloading it.


// this will multiply the translation matrix with the identity to give simply a translation matrix.
// then multiply the rotation matrix with the translation matrix to give a matrix that translates then rotates (in one go)
// and finally a scaling matrix.

// draw object here


// restore the identity matrix

NOTE : the order of the matrix multiplications REALLY matters.
remember to pop the matrix off the stack to restore the indetity at the end.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!