Sign in to follow this  
kimi

gluPerspective, glOrtho view ?

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this