Public Group

# Math: Get the plane from the polgyon?

This topic is 3668 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello all What is the formula for getting the plane from the polygon used for BSP Tree? Thank you

##### Share on other sites
Quote:
 Original post by kbundy023Hello all What is the formula for getting the plane from the polygon used for BSP Tree?Thank you
Typically you compute the supporting plane for a polygon by:

1. Taking the cross product of two non-colinear edges of the polygon and normalizing the result to yield the plane normal (if it matters which direction the normal points, you'll need to be consistent in your choice of edges).

2. Taking the dot product of the plane normal and any vertex of the polygon to yield the plane distance (depending on which convention you're using for your plane representation, you may need to negate this value).

##### Share on other sites
Quote:
Original post by jyk
Quote:
 Original post by kbundy023Hello all What is the formula for getting the plane from the polygon used for BSP Tree?Thank you
Typically you compute the supporting plane for a polygon by:

1. Taking the cross product of two non-colinear edges of the polygon and normalizing the result to yield the plane normal (if it matters which direction the normal points, you'll need to be consistent in your choice of edges).

2. Taking the dot product of the plane normal and any vertex of the polygon to yield the plane distance (depending on which convention you're using for your plane representation, you may need to negate this value).

How about if i want to find the intersection from the edge to the plane to split the polygon?

##### Share on other sites
Quote:
 How about if i want to find the intersection from the edge to the plane to split the polygon?
That's a different (and more complicated) problem. Try doing a search for 'Sutherland-Hodgman clipping'.

##### Share on other sites
Quote:
Original post by jyk
Quote:
 How about if i want to find the intersection from the edge to the plane to split the polygon?
That's a different (and more complicated) problem. Try doing a search for 'Sutherland-Hodgman clipping'.

I find the intersection of a plane with a line.

line equation : lp = a + (b - a)t

-> n . p = 0
-> n . (lp - q)
-> n . ((a + (b-a)t - q) = 0
-> n . (a + (b-a)t) - n . q = 0
-> n . a + n . (b-a) . t - n . q = 0
-> n . (b-a) . t = n . q - n . a
-> t = (n . (q - a)) / n . ( b - a )

I know the n, a, and b. But I do i find q.

##### Share on other sites
Quote:
Original post by kbundy023
Quote:
Original post by jyk
Quote:
 How about if i want to find the intersection from the edge to the plane to split the polygon?
That's a different (and more complicated) problem. Try doing a search for 'Sutherland-Hodgman clipping'.

I find the intersection of a plane with a line.

line equation : lp = a + (b - a)t

-> n . p = 0
-> n . (lp - q)
-> n . ((a + (b-a)t - q) = 0
-> n . (a + (b-a)t) - n . q = 0
-> n . a + n . (b-a) . t - n . q = 0
-> n . (b-a) . t = n . q - n . a
-> t = (n . (q - a)) / n . ( b - a )

I know the n, a, and b. But I do i find q.

Would q be any vertices on the plane?

1. 1
2. 2
3. 3
Rutin
13
4. 4
5. 5

• 26
• 10
• 9
• 9
• 11
• ### Forum Statistics

• Total Topics
633696
• Total Posts
3013397
×