Jump to content
  • Advertisement

Archived

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

ThaUnknownProgga

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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
mbarela@earthlink.net

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!