#### Archived

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

# I have point x,z on tri, need y

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

## Recommended Posts

I have terrain generated from a hieght map, where x,z form the plane, and y is hieght. I would like to be able to determine the hieght (y) of an arbitary point (x,z) on a known triangle, so that I can keep the camera a constant 2 meters over the hieght map, so I can "walk" over my terrain. My initial idea is to subtract 2 points of the triangle from the third to get 2 lines representing the sides of the triangles, then solve the equation of these lines to give me y for my given x,z, and average the results together. Is there a better way to do this? Edited by - invective on November 10, 2001 11:37:01 PM

##### Share on other sites
You have to find the intersection of the player''s position i mean the y value with the triangle, so now you have 2 points
the point holding x,y,z and the point holding x,y1,z , y1 is
the value you find intersecting the ray passing trough the player''s position and the triangle you are on, thus you have a straight line so you can find the deltay value an subtract each time to have a constant height, i hope its clear...

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 15
• 13
• 9
• 12
• 10
• ### Forum Statistics

• Total Topics
631442
• Total Posts
3000089
×