binary space partitioning!

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

Recommended Posts

Hi all, I'm trying to implement binary space partitioning in my opengl program. The problem that I'm having is that I'm not able to get the program to tell whether or not a triangle is in front or behind another one. My strategy was to find the normal of triangle A and if it intersects the plane in which triangle B is on then triangle B would be in front of it. That seems to work pretty well but the only case that it doesn't work is when the normal is parallel to the plane that triangle B is on. Is there a way around that or a better way to determine whether one triangle is in front of another? Thank you, Adam Perry

Share on other sites
Quote:
 Is there a way around that or a better way to determine whether one triangle is in front of another?
A standard method for classifying a polygon with respect to a plane is by finding the distance from each polygon vertex to the plane. If all distances are > 0, the polygon is in front of the plane; if all distances are < 0, the polygon is behind the plane; if some are > 0 and some are < 0, the polygon straddles the plane. (You'll also need to decide how to handle distances = 0.)

Share on other sites
THANK YOU VERY MUCH! I was having a lot of trouble with that and just couldn't think of any way to handle it. thanks for all of your help.

1. 1
Rutin
40
2. 2
3. 3
4. 4
5. 5

• 9
• 24
• 20
• 14
• 14
• Forum Statistics

• Total Topics
633383
• Total Posts
3011591
• Who's Online (See full list)

There are no registered users currently online

×