I have a cube that I move with glTranslate() and glRotate(). It starts its movement from 0,0,0 in the word coord system.

How can I know where it is in the world coordinate system (X,Y,Z coords)?

I mean is there a possibility to calculate the new coordinates according to the world coord system without calculating degrees, using pow() and CPU slowing stuff like that?

You can use a variables cube_x, cube_y, cube_z and your cube will be drawn where ever you want by changing the variables.

If you are moving in straight lines, then simple vector math will work. a google search will turn up tonâ€™s of examples.

But if your object is moving in a arc, then you will need to use a little math sin/cos to find the current x,y,z.

Originally posted by fortikur:

I have a cube that I move with glTranslate() and glRotate(). It starts its movement from 0,0,0 in the word coord system.

How can I know where it is in the world coordinate system (X,Y,Z coords)?

I mean is there a possibility to calculate the new coordinates according to the world coord system without calculating degrees, using pow() and CPU slowing stuff like that?