openGl object disappears at certain zCoord
<p>I have cube , which i'm trying to move using glTranslatef() function . Everything works great , except that cubeb start disappearing at z>1.</p>

<p>Here is my code</p>

<pre><code>void owidget::initializeGL()
{   
    glDepthRange(0,100);
    glEnable(GL_DEPTH_TEST);
    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
    glOrtho(-5.0,5.0,-5.0,5.0,-500.0,500.0);
}

void owidget::paintGL()
{
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    glPushMatrix();
        glTranslatef(xPos/100,yPos/100,zPos/100);
        glRotatef(xRot,1,0,0);
        glRotatef(yRot,0,1,0);
        glRotatef(zRot,0,0,1);
        cube(0.3);
    glPopMatrix(); //Fuction for dislpaying cube
}

void owidget::resizeGL(int width, int height)
{
    glViewport(0,0,width,height);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
}
</code></pre>

<p><a href="http://i.stack.imgur.com/yzNnF.png" rel="nofollow">Here is a picture</a></p>