Now i am able to rotate it with glrotatef. But if i have the wall of objects around the central object which i want to rotate around fixed axis but it seems that the axis is not constant. here is my code

Code :
static int i = 0;
 
static int angle = 0;
float distance_x, distance_y;
glClear(GL_COLOR_BUFFER_BIT);
glViewport(0, 0, 7 * width / 8, 7 * height / 8);
 
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
 
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glPushMatrix();
glTranslatef(-0.25f, 0.1f, 0.0f);
DrawHouse();
glPopMatrix();
distance_x = 0.2 * cos(i*3.14 / 180);
distance_y = 0.2 * sin(i*3.14 / 180);
 
glPushMatrix();
glRotatef(i, 0.0f, 0.0f, 1.0f);     
glTranslatef(0.5f, 0.0f, 0.0f); 
glRotatef(-i, 0.0f, 0.0f, 1.0f);
//DrawTriangle();
int angle1 =0 ;
for (int k = 0; k < 20; k++)
{
distance_x = 0.5 * cos(angle1*3.14 / 180);
distance_y = 0.5 * sin(angle1*3.14 / 180);
angle1 += 20;
glPushMatrix(); 
glTranslatef(distance_x, distance_y, 0.0f);
DrawTriangle();
glPopMatrix();
}
 
distance_x = 0.3 * cos(i*3.14 / 180);
distance_y = 0.3 * sin(i*3.14 / 180);
 
glRotatef(i, 0.0f, 0.0f, 1.0f);
glTranslatef(0.3f, 0.0f, 0.0f);
glRotatef(-i, 0.0f, 0.0f, 1.0f);
 
i++;
 
i %= 360;
angle++;
 
glPopMatrix();
 
glutSwapBuffers();
glutTimerFunc(10, animation, 0);

The video is available at http://www.youtube.com/watch?v=d3-sA...m-upload_owner

please correct me where i am going wrong