Jump to content
  • Advertisement
Sign in to follow this  


This topic is 4149 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi My program uses glFrustum to set prespective projection and I want instead a simple parallel projection. my code is:
void reshape( int w, int h )
	glViewport( 0, 0, (GLsizei)w, (GLsizei)h );
	glMatrixMode( GL_PROJECTION );
	glFrustum( -.4, .4, -.3, .3, 1., 1300. );					

	glMatrixMode( GL_MODELVIEW );

void draw( )

	glColor3f( 1., 0., 0. );
	gluLookAt( 350., 250., 250., 0., 0., 0., 0., 1., 0. );		
	glDisable( GL_LIGHTING );
	glEnable( GL_LIGHTING );
	glColor3f( 1., 1., 0. );
// some more code here for drawing meshes

// vertices lie somewhere between -250 and 250

when I try to use
glOrtho( -.4, .4, -.3, .3, 1., 1300. )

// OR

glOrtho( -1., 1., -1., 1., 1., 1300. )

instead of the glFrustum statement, I see no output what so ever any hints on the issue thanks in advance.

Share this post

Link to post
Share on other sites
Try using higher (way higher) values for left,right,bottom and top, the dimensions of your screen resolution for example.

Hint: glFrustum describes a Pyramid, glOrtho a Cube, you need a bigger cube.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!