Jump to content
  • Advertisement
Sign in to follow this  
s_akhtar

Terrain following using mesh

This topic is 4772 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 a terrain which has been rendered from a mesh (exported form maya in obj format). so the terrain has no associated height map.. now i want my vehicles to follow the terrain without using a height map...is there a way to do this using just the mesh.... i dont want to loop thru the entire mesh every time to find the height as it will make the fps very less.

Share this post


Link to post
Share on other sites
Advertisement
You could store the terrain mesh triangles in a quadtree, which would allow you to quickly determine which triangles are in the vicinity of your vehicle. For an approximate solution, you could then fire a ray straight down from your vehicle and find the intersection point with the mesh. This would probably result in your vehicle clipping into the terrain, though.

Making a vehicle accurately follow a terrain (that is, adjust its orientation relative to its wheels' positions on the terrain) is a little more difficult. I know there was a thread on the subject recently in the directx forum...*goes to look for it*...here.

As an in-between solution, you could represent your vehicle with a sphere, ellipsoid, or oriented box, and collide that object with the terrain mesh.

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!