At the moment if you rotate a 3D object like so :

`// EXAMPLE 1`

x_movement x,y,z

x_rotation rotx, 1, 0, 0

x_rotation roty, 0, 1, 0

x_rotation rotz, 0, 0, 1

x_drawobj cube, 0

We suffer from gimbal lock (is that the correct term)? - For example you can't set the object to point upwards and rotate on the Y axis and keep rotating on the X axis perfectly while manipuating y or z rotations, BUT if we do something like :

`// EXAMPLE 2`

x_movement x, y, z

x_rotation rotx, 1, 0, 0

x_pushmatrix

x_rotation roty, 0, 1, 0

x_rotation rotz, 0, 0, 0

x_drawobj cube, 0

x_pushmatrix

We can achieve the desired rotation of our object. We can then use x_getmatrix after the x_drawobj to get the coordinates of said object.

My question is this : How do I get the real angles rotx, roty, rotz from example 2 so I can draw other objects using the method in example 1? I can't base the other objects inside the original push / pop matrix as they also get changed when the original object changes rotation, I need to be able to grab the x, y, z & the rotation angles for reuse.

I'm not sure if there are other bits from the output of x_getmatrix that I can use? I've looked but the don't seem to make much sense on how to use them apart from mat[12] / 13 & 14 which are the objects x,y,z.

Bit of a messy question but I think it makes sense?