Sign in to follow this  

How many vertices can result from clipping a a triangle to a view frustum.

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

If I have a triangle and a frustum how many vertices can result from clipping that triangle to the frustum. I can only come up with 7 points. Is this really the maximum? I think that a triangle can only pass through more than 4 planes of a frustum if it passes exactly through the corners in which case it only creates one additional vertex anyways.

Share this post


Link to post
Share on other sites
In the worst case, 6*4 , assuming the frustum has 6 planes and the triangle
and its resulting part intersect the other 6-1 planes in turn.
This is a rare case, but it could happen,
More general cases depend on triangle positions , generally the formula is


P= ( original triangle points - clipped points ) * intersected frustum planes

Share this post


Link to post
Share on other sites
The triangle could potentially intersect all of the six frustum planes. You would have to test one plane after the other. For each plane two new vertices could be generated if an intersection occurs, so in the end it would be possible that you would have to generate 6*2=12 new vertices in total of which not all have to actually be used by the resulting, clipped polygon.

Share this post


Link to post
Share on other sites
Seven is the maximum for clipping to the X and Y planes, but you can get one more each from clipping to the near and far planes as well. Think of it this way - each plane can turn a single vertex of your (already partially clipped) polygon into an edge - so it takes away one vertex and adds two. So you start with a triangle = 3 vertices, and each of the 6 planes +/-X, +/-Y, +/-Z can add a single vertex each. Total = 9.

Share this post


Link to post
Share on other sites

This topic is 3658 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this