So could someone help me out here with a simple question?
I was wondering if you could change the distance at witch an object stops being drawn. And if so, how?
I hope that was clear. But just in case, Things start to disappear when I get too far away from them, I was hoping there was a way to stop that, or at least change the point at witch that happens.
~EToreo
Changing Drawing Distance
That''s probably the far clipping plane. You specify that as "zfar" in your call to glFrustum() or gluPerspective(). Just specify a larger number. Note that Z precision goes down a tiny smidgen when you make this value larger. However, it IS tiny -- most of the Z precision is determined by the near clip plane.
Typically, you hide this by applying fog, that makes things entirely fogged when they get to the far clipping plane.
If you don''t want to draw half objects, you can calculate how close they are to the clip plane: sqrt(dot the vector from camera to object center with the camera front unit vector), and add the radius of the bounding sphere of the object; if this value is greater than the far clipping plane, don''t draw the object because it might get clipped.
Typically, you hide this by applying fog, that makes things entirely fogged when they get to the far clipping plane.
If you don''t want to draw half objects, you can calculate how close they are to the clip plane: sqrt(dot the vector from camera to object center with the camera front unit vector), and add the radius of the bounding sphere of the object; if this value is greater than the far clipping plane, don''t draw the object because it might get clipped.
enum Bool { True, False, FileNotFound };
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement