PDA

View Full Version : Saving the matrix



NewROmancer
07-23-2000, 11:58 PM
How can I save an object into a file. I made the Rubik cube and now I want to sacve the position of the matrix an the position of every little cube. IS there a function as glSAve MAtrix?

Cruxis
07-24-2000, 03:38 AM
Your information was very vague,
but I will try to help you anyway.
I guess you have made Rotations/Transes
of different squares and wants to save
the current matrix to a file, yes?

float dst[4][4];
glGetFloatv(GL_MODELVIEW_MATRIX, (float*)dst);

The above to lines retrieves the current matrix and puts it in the dst array.
Just save the array to a file.

Good luck.

Marcus "Cruxis" Lenngren - Nopp.

NewROmancer
07-24-2000, 08:31 PM
Correct!Thanks

NewROmancer