Draw distance

Started by
18 comments, last by Paddeh 22 years, 5 months ago
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)
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.
"...."
push the far clip plane back eg gluPerspective( fov, ratio, near, far )
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.
Look for the function zedzeek mentioned (its very likely there somewhere ). Increase the far parameter to whatever distance you need.
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
anyone have any ideas =| ?
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
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
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.

This topic is closed to new replies.

Advertisement