   camera following object
  i am having problems of placing my camera to follow my object.  i wanted to change views everytime i oush F1 does anybody has any idea?? I would really appriciate that. I am trying to make my camera to move along my object like that:if (mode==0){   glPushMatrix();glLoadIdentity();glTranslatef(0.0,0.0,-15.0);glTranslatef(xt,yt,zt);glutSolidSphere(0.2,20,2);  glPopMatrix();glFlush(); }    else { glPushMatrix();glLoadIdentity();glMatrixMode(  GL_MODELVIEW);gluLookAt(xt,yt,zt, 0,0,0, 0,0,0);  glPopMatrix();but there''s no answer to my problem everytime i push F1 my sphere disappears!!  can anybody help me???thanx 
  It looks like your code doesn''t draw the sphere unless mode == 0 (there''s no drawing code of any kind in the other branch of the if/else). With OpenGL, if you want something to show up, you have to draw it every single frame (unless you put it in a display list, but then you still have to call that display list every single frame). ;  and even if there was a sphere:gluLookAt(xt,yt,zt, 0,0,0, 0,0,0);please look up how to use gluLookAt instead of just passing _something_ as parameters. ;  I have solved it out thanx anyways!!! and for those who still try to find the answer goes like:glLoadIdentity(); if (mode)glTranslatef(-xt,-yt,-zt - 2);glPushMatrix();glTranslatef(xt,yt,zt);glutSolidSphere(0.2,20,2);   glPopMatrix(); 