• Advertisement
Sign in to follow this  

gluPerspective, glOrtho view ?

This topic is 2374 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,

I was just playing with some code and I can't get a line and sphere both shown on screen. If I use Ortho I can see the line and if I use Perspective I can only see Sphere.

for gluPerspective mode I am using: gluPerspective(45.0f, (GLfloat)width/height, 0.1, 200.0);

If I have any negative value for near plane then I can't see even sphere. For ortho I can see the line only if near value is atleast -1.0 any postive value, nothing gets displayed.

Does anyone know how can I get both shown on screen in perspective mode?

Share this post


Link to post
Share on other sites
Advertisement
The vertices need to have a z value from -0.1 to -200.0 so that they don't get clipped by the near and far plane.

[quote]If I have any negative value for near plane then I can't see even sphere[/quote]
Read the documentation for gluPerspective or glFrustum.

This is for OpenGL
http://www.opengl.org/sdk/docs/man/

Share this post


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

  • Advertisement