Jump to content
  • Advertisement

Archived

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

Paddeh

Draw distance

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

how would i go about extending the default draw distance? my game world is kinda big, and i wish to prevent it from cutting off teh other side of my world (it stops rendering it)

Share this post


Link to post
Share on other sites
Advertisement
If your world is that huge, it would be best for it to cut of some of it. Places on your world that are not seen, shouldn''t be drawn to increase frame rates. Since it cuts off in the distance, some clever use of fog or something can give you the illusion that it doesn''t, and then only draw the current stuff that is visible. I hope that makes sense.

Share this post


Link to post
Share on other sites
thanks for the help, however, im not quite sure if i understand either of those methods :/ anything simpler?

basicly i''ve got a skybox with a world in the middle of it, if i move to one corner of my skybox the other corner gets cut off when i look towards it.

Share this post


Link to post
Share on other sites
Look for the function zedzeek mentioned (its very likely there somewhere ). Increase the far parameter to whatever distance you need.

Share this post


Link to post
Share on other sites
that function seems to be inafective, what sort of values should i be putting in? (i know it depends on the size of my world) but should there be any negative values or what?
this is wahst wrong exactly
http://www.tvsclan.f2s.com/paddy/problem copy.jpg


Edited by - Paddeh on November 9, 2001 11:59:15 AM

Share this post


Link to post
Share on other sites
Ok here''s what you do.
When drawing your world, you normally first rotate and then translate around your camera (some use the function LookAt() I believe, but I just do it manually).
When drawing your skybox, you only rotate, and not translate around the camera. That way the skybox (and in my case, sky sphere) travels with the camera through the game world and is never clipped unless it''s too big.
If you really want to see more of the world at once, you might try either scaling it down (making everything smaller so more fits) or increasing the depth buffer clip distance.
Hope that helps.
If you''re confused, here''s my code for rotating the skybox around the camera:

// Draw terrain
glLoadIdentity( );
glRotatef( -m_Camera.m_sDirection.x, 1.0f, 0.0f, 0.0f );
glRotatef( -m_Camera.m_sDirection.y, 0.0f, 1.0f, 0.0f );
glRotatef( -m_Camera.m_sDirection.z, 0.0f, 0.0f, 1.0f );
// Draw sky box/sky sphere

Share this post


Link to post
Share on other sites
thanks man how would i go about increasing the depth buffer clip distance?
Its basicly waht i want, since my world/skybox Is roughly the size i want it.
thanks again

Share this post


Link to post
Share on other sites
You would use gluPerspective( fov, ratio, near, far ); as mentioned above.
But I really suggest you don''t, unless you really really want to have more of the world visible to you (or your world is so scaled up that it''ll have the same effect as scaling the world itself down). On some slower systems this might hurt framerates significantly. I actually had to manually derive and add perspective clipping a short while ago to improve framerates in my prog =)
I also made it so you can move my skysphere closer and farther away from the camera, because I had so many polygons on the screen.

Share this post


Link to post
Share on other sites

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