Original Post
🔒 Locked
Save current matrix?
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)
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)
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement