I was trying to draw a line on the window but it is not displaying with glFrustum()
. I have used the same code with glOrtho()
it does display the line. Is there anything else I need to set up for my line to show up on set window?
void init() {
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum( -2.0,2.0,-2.0,2.0, 1.0, 20.0 );
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
void display() {
glBegin(GL_LINES);
glColor3f(0.0f, 0.0f, 1.0f);
glVertex3f(0.0f, 0.0f, 2.0f);
glVertex3f(1.0f, 1.0f, 5.0f);
glEnd();
}