   Problem with back-culling and projection
  Hi,Im very new to 3D-programming, though I have pretty good skills in C/C++ and 2D-programming. Im trying to learn by practice; I've found some assignments that i'm trying to complete myself.Something really odd is happening though. Im trying to build a diamond using openGl/GLUT and the Gl_BEGIN()/GL_END(). There is also a camera rotating around the object. It seems as if the Z-buffer isn't updated with the position of the camera, because the back-culling is only correct when the camera is in a specific position.I'm trying to figure out what i'm missing, but its getting really frustrating. Here is the code for the camera and for creating the polygons:void draw(){glPolygonMode(GL_FRONT, GL_FILL);glPolygonMode(GL_BACK, GL_LINE);glEnable(GL_CULL_FACE);glCullFace(GL_BACK); glColor3f(0, 0, 0);glBegin(GL_QUADS);glVertex3f(10, -10, 10);glVertex3f(10, -10, -10);glVertex3f(-10, -10, -10);glVertex3f(-10, -10, 10);glEnd();glColor4f(1,0,0,0.1); //Create a primitive(QUAD) with four vertexesglBegin(GL_QUADS); glVertex3f(-5, -5, 5);//X,Y,Z (flyttal)glVertex3f(-5, -5, -5);glVertex3f(-5, 5, -5);glVertex3f(-5, 5, 5);glEnd(); // Stop creating primitive//Create a primitive(QUAD) with four vertexesglBegin(GL_QUADS); glVertex3f(5, -5, 5);//X,Y,Z (flyttal)glVertex3f(5, -5, -5);glVertex3f(5, 5, -5);glVertex3f(5, 5, 5);glEnd(); // Stop creating primitive//Create a primitive(QUAD) with four vertexesglBegin(GL_QUADS); glVertex3f(5, -5, 5);//X,Y,Z (flyttal)glVertex3f(-5, -5, 5);glVertex3f(-5, 5, 5);glVertex3f(5, 5, 5);glEnd(); // Stop creating primitive//Create a primitive(QUAD) with four vertexesglBegin(GL_QUADS); glVertex3f(5, -5, -5);//X,Y,Z (flyttal)glVertex3f(-5, -5, -5);glVertex3f(-5, 5, -5);glVertex3f(5, 5, -5);glEnd(); // Stop creating primitive}////void display(){glClearColor(1, 1, 1, 1);glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);   // Vi vill rensa både skärmbuffer och z-bufferglMatrixMode(GL_MODELVIEW);glLoadIdentity();gluLookAt(cos(shared.time) * 40, 10, sin(shared.time) * 40, 0, 0, 0, 0, 1, 0);   // Roterar kameran kring origo genom att skapa en ny vymatris varje bildrutadrawFloor();glutSwapBuffers();}I would really appreciate some help =)   