Sign in to follow this  
kobe bryant

bumpy terrain algorithm

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this