# 3D Polygon intersection

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

## Recommended Posts

HI, im looking for an algortihm that is able to finde the intersection of 2 polygons ind 3D.the polygons are convex and usually habe 3 , 4 or 5 edges. ex: input p1=[(x1,y1),(x2,y2),(x3,y3)] , p2=[(m1,n1),(m2,n2),(m3,n3)] output = intersection of p1 and p2 thanks for your help

##### Share on other sites
If two convex polygons intersect, at least one edge of one polygone penetrates the other polygon.

Take the vertices of the first polygon and check them against the plane of the second. If they are all on the same side of the plane the polygons can't intersect, but if at least one vertex is on the other side of the plane, you compute the intersection point of the edges consisting of vertices on different sides of the plane and the plane itself. If this intersection point lies inside the second polygon, your polygons intersect.

But this istn't enough, you'll also have to check the vertices of the second polygon and against the plane of the first.

You could also compute the line where the planes of the two polygons intersect and check if it lies inside both polygons.

[Edited by - DraganO on July 14, 2008 9:42:38 AM]

##### Share on other sites
Quote:
 Original post by ghez_ghuzakHI,im looking for an algortihm that is able to finde the intersection of 2 polygons ind 3D.the polygons are convex and usually habe 3 , 4 or 5 edges.ex: input p1=[(x1,y1),(x2,y2),(x3,y3)] , p2=[(m1,n1),(m2,n2),(m3,n3)] output = intersection of p1 and p2thanks for your help

1. 1
2. 2
3. 3
Rutin
15
4. 4
khawk
13
5. 5
frob
12

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633665
• Total Posts
3013245
×

## Important Information

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!