# how do you draw footsteps on terrain ?

This topic is 3631 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

how do you draw footsteps on terrain ?

##### Share on other sites
Quote:
 how do you draw footsteps on terrain ?
Probably by using decals of some sort. (Searching the forum archives for 'decals' should lead you to some good references.)

##### Share on other sites
Well, I guess the easiest way would be to check for the players position, then find the corresponding triangle on the terrain relative to where the player is. Then use the normal of that triangle to find the rotation of the decal you'd need. Then record the position and the rotation, and possibly a time stamp, into a list. Iterate through the list and draw the decal at each position and rotation, and compare the time stamps. If the time is greater than X, take that one out of the list.

##### Share on other sites
Quote:
 Original post by JParishyWell, I guess the easiest way would be to check for the players position, then find the corresponding triangle on the terrain relative to where the player is. Then use the normal of that triangle to find the rotation of the decal you'd need. Then record the position and the rotation, and possibly a time stamp, into a list. Iterate through the list and draw the decal at each position and rotation, and compare the time stamps. If the time is greater than X, take that one out of the list.
This will occasionally result in footprints that 'hang' over the edges of the triangles that make up the terrain. To avoid this problem, you'll want to use a more sophisticated method, such as clipping or projection.

Again, a search for 'decals' should turn up plenty of references.

##### Share on other sites
I've never done it before, myself, that's just the first thing that came to mind. Although you are probably right.

##### Share on other sites
Quote:
 Original post by jykThis will occasionally result in footprints that 'hang' over the edges of the triangles that make up the terrain. To avoid this problem, you'll want to use a more sophisticated method, such as clipping or projection.Again, a search for 'decals' should turn up plenty of references.

A simple solution for this is to grab the closest heightmap quad(s), create a decal with the same properties/height of the terrain and simply modify the texture coords to line up the footprint with the feet.

##### Share on other sites
Or just use another texture stage where the texture shall contain only the footsteps and blend it with the terrain. This gives you the option to put it anywhere inside your blending cascade (for terrain).
Of course, youll have to handle the corner cases. Th easiest fix is to not allow the footstep to go outside the range and always be alinged with the chunks border, which might not be an issue, depending on size of terrain chunk/amount of vegetation and visibility of the footsteps.

##### Share on other sites
i am gonna learn Decals Right Now.! Thank you All For Great Answers.it was just the information That i was looking for !

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 23
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631766
• Total Posts
3002234
×