i've done a little ogl application: there are a triangle and a square
centered on the screen (both are white).
Before of render them i setup the camera ( using gluLookAt() and making the
camera face the 2 objects ).
I can also animate one of them (e.g.: i make the triangle rotate on his
z-axe CCW), but i can't animate BOTH !!!
In my framework render() method i setup the camera that executes a simple
gluLookAt(), then i call the Render() method of all the objects that are in
my world (in this test only 2),like this:
glClear( GL_COLOR_BUFFER_BIT );
_camera->Render() // gluLookAt
_objects->Render(); // Square
_objects->Render(); // Triangle
Each object inherits from a virtual base class called BaseObject.
The main code of the Render() of the objects is :
calculation of deg (rotation degrees)
// Pivot is a private member that represent the rotation pivot
glTranslatef( _pivot.X(), _pivot.Y(), _pivot.Z() );
glRotatef(- deg, 0, 0, 1);
glVertex of each vertex
I can see only the first object that calls Render method (in this example
the square) and i see it in the right way (eg: rotating), but i can't see
the second one !
If i swap the 2 object[i]->Render calls i see only the triangle, not the
Thanks a lot !!!