Advertisement

Terrain and plane intersection

Started by June 25, 2003 09:15 AM
0 comments, last by brucesinner 21 years, 8 months ago
Hi folks! I need to intersect a triangulated terrain with a plane, so I will be creating 2d curves from the intersection points. Whats the best way to do the intersection? More: I intersect and get a set of vertices...but imagine a two peak terrain split by a plane...it will create two curves from the intersection...I'll have the intersection points but how do I know which points belongs to one curve and which ones belongs to another??? Here is a image for better understanding: Thanks, [edited by - brucesinner on June 25, 2003 11:24:26 AM]
"Steel and Fire,Spreading the Holy Word,Dirty Liars,The truth has never been told" - Primal Fear
Is every vertex shared by 2 or more triangles?

If this is true:
1--2--3|\ |\ || \| \|4--5--6  


Now lets say that vertices 2, 4, and 5 are under the plane. Vertices 1, 3, and 6 are over the plane. So vertex 1 is separated from 3 and 6, making 2 groups of triangles. You know which vertices are in which group even before you do the intersection.

Here's an idea (just off the top of my head):
Let group = 0Mark every vertex under the plane as group 0while any unmarked vertex exists{ Increment group  find next unmarked vertex  mark it as group  for every triangle sharing vertex  {  for every unmarked vertex on the triangle     { mark it as same group     }  }}Do your intersection to find the new vertices.for each new vertex{ search triangles sharing vertex for 1 non-zero-grouped vertex  mark new vertex as same group}  


Hope that helps...

-solo (my site)
(edited to clarify something)

[edited by - 5010 on June 25, 2003 11:54:04 AM]
-solo (my site)

This topic is closed to new replies.

Advertisement