okay guys, i've already created a satellite but now i need it to rotate....i did something like this...
void myDisplayFunc(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glTranslatef(posX, posY, posZ);
glRotatef(rotateX, 1.0f, 0.0f, 0.0f);
glRotatef(rotateY, 0.0f, 1.0f, 0.0f);
glRotatef(rotateZ, 0.0f, 0.0f, 1.0f);
glScalef(scaleX, scaleY, scaleZ);
GLUquadricObj *pObj = gluNewQuadric();
gluQuadricDrawStyle(pObj, GLU_FILL);
gluQuadricNormals(pObj, GLU_SMOOTH);
setup();
drawBackground();
planet(pObj);
glRotatef(-90,1,0,0);
glTranslatef(0,-2,0);
for(int i = 0; i < 360; i+= 30){
glPushMatrix();
glRotatef(ypoz, 0.0f, 1.0f, 0.0f);
glTranslatef(0,10,0);
glRotatef(i,0,1,0);
drawSeat(pObj);
glPopMatrix();
}
glPopMatrix();
glFlush();
glutSwapBuffers();
}
the thing is its creating alot of satellite, i juz need one to rotate....help me out pls...