Advertisement

Point in a triangle

Started by July 24, 2000 03:54 PM
0 comments, last by ThaUnknownProgga 24 years, 5 months ago
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?
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 www.acm.org/tog/graphicsgems or look up Badouels ray/poly intersection algorythm.



Mike Barela
mbarela@earthlink.net
Mike BarelaMikeB@yaya.com

This topic is closed to new replies.

Advertisement