Jump to content
  • Advertisement
Sign in to follow this  

Save current matrix?

This topic is 4301 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

Advertisement
indeed there is a way to do this, the function glGetDoublev(GL_MODELVIEW_MATRIX, modelMatrix); will get you the values of the modelview matrix. glGetDoublev just takes the floating point values of the first parameter and stores it in the second parameter. In this case you will want to pass either an array of 16 floats (by passing the name of the array, in this case modelMatrix) or a pointer to a float where you will be storing the 16 values (remember these are 4x4 matrices).

You can use this for much more then just getting the current values of the matrix, and you can actually get the values of other OpenGL matrices as well. Check out the MSDN for a more detailed description (the entry for glGetDoublev also tells you what parameters are acceptable)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!