Jump to content
  • Advertisement
Sign in to follow this  
kobe bryant

bumpy terrain algorithm

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

Can someone please tell me how you get a character to adjust its position according to the height of the terrain at a particular place. I know it has something to do with interpolating the vertex points and adjusting the characters height accordingly, but it seems to me that the resolution of the heightfeild terrain would have to be extremely high for this to be convincing and wouldn't that entail hundreds of bounding shapes at each quad. Thanx in advance for any help.

Share this post


Link to post
Share on other sites
Advertisement
Find the triangle that you're standing on then do a triangle-ray intersection test where the ray is a line that's normal to the terrain plane.

Share this post


Link to post
Share on other sites
If your using a texture map to create your terrain mesh, you can just use the x,z position of the character to sample the texture and bingo you have the height to move your character to. You could use the normals to rotate the character so that they are oriented with the terrain too.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!