#### Archived

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

# Triangular Interpolation...

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

## 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 on other sites
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 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

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5

• 13
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632993
• Total Posts
3009763
• ### Who's Online (See full list)

There are no registered users currently online

×