PDA

View Full Version : How to get the current state matrix



Leonardave
06-03-2009, 09:54 PM
Hi,

How can I get the current opengl state mechine value(the state matrix), is there any opengl function to get the current matrix? Thanks a lot!

Leo

scratt
06-04-2009, 02:29 AM
You mean something like this?

GLdouble projMatrix[16];
GLdouble modelMatrix[16];
glGetDoublev(GL_PROJECTION, projMatrix);
glGetDoublev(GL_MODELVIEW, modelMatrix);

All the glGetXX commands will get you various values depending on what you ask them for...

Dark Photon
06-04-2009, 06:23 AM
How can I get the current opengl state mechine value(the state matrix)

See this (http://www.opengl.org/wiki/Viewing_and_Transformations#How_do_I_get_the_activ e_MODELVIEW_or_PROJECTION_matrices.3F) and this (http://www.opengl.org/sdk/docs/man/xhtml/glGet.xml)

Leonardave
06-04-2009, 09:32 PM
Hi,

How many matrix stacks are used during opengl rendering usually, and What is the initial size of opengl state such as MODELVIEW matrix stack?

Thanks,

leo

ZbuffeR
06-05-2009, 03:06 AM
These details are all in the docs and specs.
http://www.opengl.org/sdk/docs/man/