Jump to content
  • Advertisement


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


Clipping Planes

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

Hi, Could anyone Help me? I want to Calculate Polygons for the front and Far Clipping Planes in Direct 3D. I use the DX - Helper Function to create my Projection Matrix. for Example, i use a FoV of 45 degrees and a near plane of 1. then i create a Vector (0, 0, -1) and rotate it (45/2) degrees in Y and Z - Axis. Because the resulting length of the Vector == 1 and the near plane == 1 i thought it would be correct. But if i create all other 3 Points for the Surface, i got one, that was too small. Does anyone know, how i can calculate them right? I have heard, that i have to include a "User distance" to my calculations, but i couldnt find a value for it.

Share this post

Link to post
Share on other sites
One quick and dirty way to find a good distance from the front clipping plane to the back clipping plane is to look at the radius of the bounding sphere of all your geometry. If you have a sphere with that radius, then all your geometry lies within it. If you then make a view frustum that can contain the entire bounding sphere, then that view frustum can also include all of your geometry. So just make sure the back clipping plane is twice the radius of the bounding sphere away from the front clipping plane.

This isn''t a completely problem-free solution. It is only guaranteed to work for any orientation of your geometry if:

1) your geometry is located such that the "centroid" point is exactly halfway between the front and back clipping planes (e.g., the geometry is centered within the center of the bounding sphere that you used to place the clipping planes).

2) your viewport clip planes (top, bottom, right, left) are also far enough apart to contain the bounding sphere.

If you want your object to be able to move around the screen without being clipped, you need to make the viewport clip planes further apart and your front/back clip planes further apart.

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!