PDA

View Full Version : location of drawn object in world-coordinates



aiscape
02-03-2003, 03:30 AM
Hi!
I transform an object like this:

glLoadIdentity();
glTranslatef(-3,0,0);
glRotatef(30.0,0.0,1.0,0.0);
glTranslatef(3,0,0);
glCallList(objectList);

Is there a possibility, to extract the new location (x,y,z in worldcoordsystem and the "slope"-angles) of my object or have I calculate this manually?

Thanks, Jan.

jwatte
02-03-2003, 11:35 AM
If by "world" you mean "eye" coordinates, then you can get that information out of the MODELVIEW matrix. The top-left 3x3 is your three axes of orientation; the 3 bottom elements are the position (translation).