I am trying to draw a triangle which is translated 6 units into the screen. The program runs but I cannot see the triangle. I can only see the triangle if I translate less then or equal to ±1 along the z axis.
Why can't I see it when I try to translate it -6 units in the z direction?
Here is the code
#include <SFML/Graphics.hpp>
int DrawGLScene()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0.0f,0.0f, -6.0f);
glBegin(GL_TRIANGLES);
glVertex3f( 0.0f, 1.0f, 0.0f); // Top
glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left
glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right
glEnd();
}
...