PDA

View Full Version : trackball



Zak
04-21-2003, 06:24 AM
I am having a problem to return to last 3-d position of my object. I would like to have the same 3-d view when I exit and return back to the program.

glMatrixMode GL_MODELVIEW
glGetFloatv GL_MODELVIEW_MATRIX, objectXform
glLoadIdentity
glRotatef d_X, 0, 1, 0
glRotatef d_Y, 1, 0, 0
glMultMatrixf objectXform
Form_Paint

Is there a way to save the current transformation matrix in a file and bring it back up?

mikael_aronsson
04-22-2003, 04:22 AM
Hi !

I am not sure what you are trying to do, the glGetFloatv( GL_MODELVIEW_MATRIX, p) will return the current matrix as 16 floating point values, you can save this if you want and later restore it with glLoadMatrixf()

Mikael

Zak
04-22-2003, 09:47 AM
I am just starting with OpenGL. This is the answer I need. It works!