how do i find a rotation

hello everyone.

just wondering if there is any simple way for finding out the new rotation x,y,z of an object after using a rotation on at object.

if i say ‘glRotatef(180f, 0f, 1f, 0f);’ on every update frame. how can i just ask the matrix what the x, y, z of the rotations have been changed to. i wont to save anlges of objects so i can use them later.

i can do a:

float[] mat = new float[16];
gl.glGetFloatv(GL_MODELVIEW_MATRIX, mat);

and pull out the transformations useing mat[12], mat[13], mat[14] no problem. now i need the rotation x, y, z. Any one tell me how i get them ?

You can save the matrix with PushMatrix() and to retrieve it with PopMatrix(). So at every frame you save current the matrix in the stack. The problem is with the space in the stack.


i understand how to push and pop the matrix, my problem is when i do a rotation the matrix changes ‘i guess’ how do i get the x, y, z new rotations positions ?

i wont to send the x, y, z rotations over the net from a server i writen. i need to send the x, y, z rotations so everything can start in the same places on the users computer…

bit like setting the stage, ‘posistions everyone’ ‘now lets move’…