OGL_PGR
09-21-2005, 03:23 AM
Please help me to resolve the following issue:
I want to 'extract' the object's coordinates and pass it to the camera.
The object lies in a different co-ordinate system.
-----------------------------------------------
glPushMatrix();
---//translate the co-ord system
---glTranslatef( a, b, c);
------glPushMatrix();
---------glTranslatef(obj.x, obj.y, obj.z);
---------glRotatef(...);
------------DrawObject();
------glPopMatrix();
glPopMatrix();
-----------------------------------------------
Earlier, camera was focusing on object's x,y,z. But now, after ' glTranslatef( a, b, c) ' ; things have gone wrong.
So how do I get the object's xyz with respect to GLOBAL COORDINATE system and pass it to the camera.
Thanks.
I want to 'extract' the object's coordinates and pass it to the camera.
The object lies in a different co-ordinate system.
-----------------------------------------------
glPushMatrix();
---//translate the co-ord system
---glTranslatef( a, b, c);
------glPushMatrix();
---------glTranslatef(obj.x, obj.y, obj.z);
---------glRotatef(...);
------------DrawObject();
------glPopMatrix();
glPopMatrix();
-----------------------------------------------
Earlier, camera was focusing on object's x,y,z. But now, after ' glTranslatef( a, b, c) ' ; things have gone wrong.
So how do I get the object's xyz with respect to GLOBAL COORDINATE system and pass it to the camera.
Thanks.