Archived

This topic is now archived and is closed to further replies.

jwblair

Please help me with my Camera Code...

Recommended Posts

This is what I have so far...and it is just blank. Not sure why? How must I correct my code for it to work? Please ANYONE..HELP! Thanks! void DrawComplex(void){ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer glMatrixMode( GL_PROJECTION ); glLoadIdentity(); gluPerspective(50.0,1.0,3.0,7.0); glMatrixMode( GL_MODELVIEW ); glLoadIdentity(); gluLookAt(1,1,1, 0,0,0, 0,1,0); /* Draws a Line */ // Builds a Cross Hair at the Origiin // X-Axis is Blue // Y-Axis is Green // Z-Axis is Red glBegin(GL_LINES); glLineWidth( 1.0 ); glColor3f( 0.0, 0.0, 1.0 ); glVertex3f(-10,0,0); glVertex3f(10,0,0); glColor3f( 0.0, 1.0, 0.0 ); glVertex3f(0,-10,0); glVertex3f(0,10,0); glColor3f( 1.0, 0.0, 0.0 ); glVertex3f(0,0,-10); glVertex3f(0,0,10); glEnd(); /* Draws a triangle */ glBegin(GL_TRIANGLES); // Drawing Using Triangles glColor3f( 1.0, 0.0, 0.0 ); // Red glVertex3f( 0.5f, 1.0f, 0.0f); // Top glColor3f( 0.0, 1.0, 0.0 ); // Green glVertex3f(0.0f, 0.0f, 0.0f); // Bottom Left glColor3f( 0.0, 0.0, 1.0 ); // Blue glVertex3f( 1.0f,0.0f, 0.0f); // Bottom Right glEnd(); // Finished Drawing The Triangle }

Share this post


Link to post
Share on other sites
The far range should be something large. For portal or BSP engines, you can just make it, for all intents and purposes, infinite, like 10000. For outdoor terrain engines, you can either keep it large so all geometry would always be rendered, or smaller so very distant terrain is cut off (though your program itself should cull distant terrain before sending it to the 3D card).

~CGameProgrammer( );

Share this post


Link to post
Share on other sites