Archived

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

Making Infinite Space in OpenGL

This topic is 5514 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

I set up my viewing planes usually gluPerspective. It looks something like this:
gluPerspective(75.0f,(GLfloat)width/(GLfloat)height,1.0f,1000.0f);

Where:
width = screen width
height = screen height
1.0f = near clipping plane
1000.0f = far clipping plane

Keep in mind, your depth buffer is affected by the near and far clipping planes. The near plane cannot be less than zero. Setting the far clipping plane too far out will cause "popping" of objects, since your depth buffer is not linear, but more concentrated closer to the near clipping plane.

Hope that helps.

----------------
Interesting quote deleted at request of owner

Share this post


Link to post
Share on other sites
If the object is extremely far away, and you don''t ever wnat to lose sight of it, you could render a scaled down version of it close to the far clipping plane just to keep it visible. Recalculate its size and scale accordingly before you render it. That way you don''t need to resize the viewing frustum, and you maintain the integrity of your depth buffer.

Share this post


Link to post
Share on other sites
quote:
Original post by petewood
if you could see things an infinite distance away then the whole sky would be white with stars


It will be, the universe just isn''t old enough.



Gyzmo
==============================
"Well is the world standard" - The Alchemist
"Not in Canada!" - jonnyfish

Share this post


Link to post
Share on other sites