Jump to content
  • Advertisement

Archived

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

pollier

Triangular Interpolation...

This topic is 6064 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

Suppose I have a triangle in 3D space. If I look at it from overhead it looks two-dimensional. If I take a 2D point (X and Z axis) and place it anywhere on the triangle, how can I get the Y coordinate based on the heights of the other three points? I know this would be done by interpolation, and I know how to interpolate a square, but this is a triangle that''s not necessarily equilateral. Suggestions? "No break ''till you die!" - Mr. Foster, my English teacher

Share this post


Link to post
Share on other sites
Advertisement
Your triangle is in fact a plane. Just do a google search on "point in a plane" equation and use that.

You will also need to do a "point inside a triangle" test. There is a very fast algorithm thats hard to find. Its incredibly simple and simply returns a positive number if its inside the triangle, negative if it isnt. This is what the java Polygon.contains() (or inside() if you are using Java 1.0) uses so look at those if you cant find it online.

Nitzan

-------------------------
www.geocities.com/nitzanw
www.scorchedearth3d.net
-------------------------

Share this post


Link to post
Share on other sites
Er... Is there any way of doing it with interpolation? That would work much better with my app. Thanks for the tip on testing, I was going to use the old "find the sum of the interior angles" method.

"No break 'till you die!"
- Mr. Foster, my English teacher

Edited by - pollier on January 9, 2002 8:07:50 PM

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!