#### Archived

This topic is now archived and is closed to further replies.

# Point in a triangle

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

## Recommended Posts

Ok, imagine you are viewing a triangle from overhead, IE it has a normal that is facing "up" in the world. Each vertice has a different height value, IE each vertices y values are different. Now imagine viewing that triangle overhead as if it''s a 2 dimensional picture. given an X Y coordinate (2d, remember), how would you determine the 3 dimensional y value? Argh that''s confusing, let me try some pictures. _______ | / | / | P / | / | / |/ I know P''s offset from the left side of the triangle and it''s offset from the bottom of the triangle, so to make it a 3d point i need to set it''s "height" so that it lies on the triangle at that specific place. how do i find this "height" value?

##### Share on other sites
Ok, im not exactly sure what your asking. How about a little clarification. Are you looking for the the y value of the vertices or are you looking for an arbutrary point(p im assuming) in the triangle? If you are looking for an arbitrary point in the triangle you need to first test to make sure the point is contained in the triangle and then transform the point into a coordinate system based on the axes defined by the u and v values.

If your not good with this kind of stuff check out [url]www.acm.org/tog/graphicsgems[/url] or look up Badouels ray/poly intersection algorythm.

Mike Barela

1. 1
Rutin
24
2. 2
3. 3
JoeJ
18
4. 4
5. 5

• 38
• 23
• 13
• 13
• 17
• ### Forum Statistics

• Total Topics
631706
• Total Posts
3001835
×