Original Post
Quick question that would help me out a lot:
If I were to tranlsate the amount (x,y,z)
glTranslatef(x, y, z);
// then rotate a certain amount
glRotatef(xRotate, 1, 0, 0);
glRotatef(yRotate, 0, 1, 0);
glRotatef(zRotate, 0, 0, 1);
// then translate backwards the same amount as previous
glTranslatef(-x, -y, -z);
This is for rotating an object around a pivot point that is at (x, y, z) by xRotate on the x axis, yRotate on the y Axis, and zRotate on the z axis. This works fine, but I lose track of what the objects coordinates are after doing these operations on it. How can i get the coordinates i am at directly after this code? Without using the law of cosines please, that will work but I really don''t want to use that. Can I somehow get these coordinates out of the matrix that ive done these translations/rotations on? I know that openGL has done the math for me, which is one reason why I don''t just use the law of cosines.