Advertisement

Please help me with my Camera Code...

Started by March 20, 2001 09:28 PM
3 comments, last by jwblair 23 years, 10 months ago
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 }
Thanks!John William Blair "The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of the darkness. For he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee."
http://members.home.com/chucklez/wtc/index.html
It looks like your objects migh be outside of your near-far range.
Advertisement
Well I''ll be damned! I changed my perspective and that worked! Yeeee-Haw!

Thakns Dude!
Thanks!John William Blair "The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of the darkness. For he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee."
http://members.home.com/chucklez/wtc/index.html
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( );


~CGameProgrammer( ); Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
Thanks y''all for ya help!

Yeee-HAW!!!!!!!!!!!!

Thanks!

John William Blair
Thanks!John William Blair "The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of the darkness. For he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee."
http://members.home.com/chucklez/wtc/index.html

This topic is closed to new replies.

Advertisement