Hi,
I am learning OpenGL.
I have written following code in (MFC)Vc++…
void CSim_4_26_02View::draw3dobject()
{
glClear ( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT ) ;
glColor3f ( 1.0f, 1.0f, 1.0f ) ;
glBegin ( GL_LINES);
glVertex3f(0.0f,0.5f,0.0f);
glVertex3f(0.5f,0.5f,0.0f);
glVertex3f(0.0f,0.0f,0.0f);
glVertex3f(1.0f,1.0f,0.0f);
glVertex3f(-0.5f,-0.5f,0.0f);
glVertex3f(-0.75f,-0.75f,0.0f);
glVertex3f(0.0f,0.0f,0.0f);
glVertex3f(-1.0f,-1.0f,0.0f);
glEnd();
glFlush();
}
When I run the program i am able to see line …
But when I add commands like gluLookAt or gluPerepective in the code…I am not able to see any thing…what can be the problem…
void CSim_4_26_02View::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
glViewport(0,0,cx,cy);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluPerspective(90.0,1.0,1.0,10.0);
// gluLookAt(0,0,3,0,0,0,0,1,0);
//glFrustum ( -5.0, 5.0, -5.0, 5.0, -2.0, 7.0 ) ;
draw3dobject();
}
Can anybody tell me what I am doing wrong…
Thanks in advance
aus