bumpy terrain algorithm

Started by
1 comment, last by moagstar 18 years, 7 months ago
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.
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.

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.

This topic is closed to new replies.

Advertisement