   Camera movement issue
  Hi,i have a strange bug, that i dont understand.In order to explain, i attach 2 screenshots:http://www.captured-dreams.de/temp/screen1.jpghttp://www.captured-dreams.de/temp/screen2.jpgOn screen 1 you see the startup look. Now i try zooming into the scene by adjusting the zeye value:zeye--;here is my display() function:void display ( void )   // Create The Display Function{// Clear Screen And Depth BufferglClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);gluLookAt (xeye, yeye, zeye, xfocus, yfocus, zfocus, 0,1,0);// Draw the CubemyCube.draw(); // Draw the items  DrawItems();  glutSwapBuffers();// Swap The Buffers To Not Be Left With A Clear Screen}As you see the camera zooms into the cube, but the icons have somehow moved. They dont keep their old position. I cant figure out why.Any ideas?   
  Any changes to the modelview matrix (which is what gluLookAt does) affect every call that comes after them. You may want to consider switching to an orthographic projection for your icons. Alternatively, adding glMatrixMode(GL_MODELVIEW); glPushMatrix() before the call to gluLookAt and glPopMatrix() before the call to DrawItems.   ;  First of all, changing the zeye value does not perform a zoom; it performs a translation of the camera along the global z axis instead! Besides that, the OP gives absolutely no hint what is furthur done inside myCube.draw() and DrawItems() to the matrix stack.   ;  Hi,i tried your suggestions, but no success - nothing changed.Cube.draw:void Cube::draw() {glLineStipple(2, (short) 0x00FF);glEnable(GL_LINE_STIPPLE);glBegin(GL_LINES);glColor3f(0.4f,0.69f,1.0f);//Blau glVertex3f(-2.5, -2.0, 0.0);//Links unten horizontalglVertex3f(-2.5, -2.0, -3.0);glVertex3f(-2.5, -2.0, -3.0);//Hinten unten horizontalglVertex3f(2.5, -2.0, -3.0);glVertex3f(2.5, -2.0, -3.0);//Rechts unten horizontalglVertex3f(2.5, -2.0, 0.0);glVertex3f(2.5, -2.0, 0.0);//Rechts vorne vertikalglVertex3f(2.5, 2.0, 0.0);glVertex3f(2.5, 2.0, 0.0);//Rechts oben horizontalglVertex3f(2.5, 2.0, -3.0);glVertex3f(2.5, 2.0, -3.0);//Rechts hinten vertikalglVertex3f(2.5, -2.0, -3.0);glVertex3f(2.5, 2.0, -3.0);//Hinten oben horizontalglVertex3f(-2.5, 2.0, -3.0);glVertex3f(-2.5, 2.0, -3.0);//Hinten links vertikalglVertex3f(-2.5, -2.0, -3.0);glVertex3f(-2.5, -2.0, 0.0);//Vorne unten horizontalglVertex3f(2.5, -2.0, 0.0);glVertex3f(-2.5, -2.0, 0.0);//Vorne links vertikalglVertex3f(-2.5, 2.0, 0.0);glVertex3f(-2.5, 2.0, 0.0);//Oben links horizontalglVertex3f(-2.5, 2.0, -3.0);glVertex3f(-2.5, 2.0, 0.0);//Vorne oben horizontalglVertex3f(2.5, 2.0, 0.0); glEnd();glDisable(GL_LINE_STIPPLE);}------------------------------------------DrawItems():void DrawItems() {glColor4f(1.0f, 1.0f, 1.0f, 1.0f);// Set positionglTranslatef(x , y, z); // Draw all icons in the vectorfor(int i=0; i < myIcons.getIconVectorALL().size(); i++) {glLoadIdentity();  glPushMatrix(); glBegin(GL_QUADS); // QuadglTexCoord2f(0, 0);glVertex3f(-0.08f, 0.08f, 0.02f);    glTexCoord2f(0, 1); glVertex3f(-0.08f,-0.08f, 0.02f); glTexCoord2f(1, 1); glVertex3f( 0.08f,-0.08f, 0.02f);  glTexCoord2f(1, 0); glVertex3f( 0.08f, 0.08f, 0.02f); glEnd();glPopMatrix();}How would you zoom into the scene?   ;  it depends what you mean by zoom. If you mean 'move closer' then you're already doing the right thing. If you mean 'simulate a camera zoom lense' you should try changing your field of view. You don't say how you're setting up your projection, but googling 'opengl fov' should give you some ideas.   ;  Hi,yes I mean getting closer to the scene.My problem is that i´m getting closer to the cube, which is drawn in cube.draw, but the icons, which are drawn in DrawItems() stay at the same distance from the camera. So when i move camera into the scene, the icons step away from the camera.;  I'm not sure I understand what you're trying to achieve - when you move towards the box, do you want the icons to stay in the same position on screen OR do you want to move towards / through them as well?The transformations you're doing in DrawItems seem a little confused (possibly my fault, sorry!). At the moment you're doing this:translatefor (all icons): &nbsp set the current matrix to identity (what this does will depend on the most recent call to glMatrixMode, but assuming GL_MODELVIEW, you're just undoing the previous translation!)   store the current matrix state (the identity)   draw a quad   reset the current matrix to what was stored (the identity)   