Jump to content
  • Advertisement

Archived

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

invective

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.

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

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


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

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!