   simple example with transformations
  Hi,this is my first post here, so hi all ; pI'm totally new to OpenGL, so sorry for noobish questions. I have very simple example with transforms:    glLoadIdentity();    // 1. drawing a cube    glColor3f( 1,1,0);    glutWireCube(1.0);// 2. placing cameragluLookAt( 0,0,dist,   0,0,dist+side,  0,1,0 );// 3. drawing a sphere for orientationglTranslatef(0,0,-5);glutSolidSphere( 1.0, 16, 20);my question is: why cube is moving with viewpoint? This is what I think:1.Drawing a cube. Each vertex is going through vertex pipline, so It undergoes several transformations, including multiplication with modelview matrix. At the end of this proces it gains it's windows coordinates. Here modelview matrix is identity, so it doesn't affect position of the cube. So cube ends in position at the origin (it remains stationary).2.Placing a camera. It doesn't affect position of cube, since it's done (camera positioning) after drawing a cube.As the result, cube should remain stationary, and only the camera should change it's position.P.S. sorry for bad english ; p   
  You forgot glMatrixMode() before tweaking matrices ;)   ;  Well, this is only extract from my code, I didn't forgot about setting glMatrixMode. It is set to glMatrixMode( GL_MODELVIEW ) ;p   ;  Try:  glLoadIdentity();// 2. placing cameragluLookAt( 0,0,dist,   0,0,dist+side,  0,1,0 );    // 1. drawing a cube    glColor3f( 1,1,0);    glutWireCube(1.0);// 3. drawing a sphere for orientationglTranslatef(0,0,-5);glutSolidSphere( 1.0, 16, 20);You were drawing the cube and then setting the view, which would make the cube appear to be moving with the camera (as it remains stationary whereas the sphere is being transformed by the view).   