how do you draw footsteps on terrain ?

Started by
6 comments, last by jamesss 15 years, 8 months ago
how do you draw footsteps on terrain ?
Advertisement
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.)
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.
Quote:Original post by JParishy
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.
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.
I've never done it before, myself, that's just the first thing that came to mind. Although you are probably right.
Quote:Original post by jyk
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.


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.
"Game Maker For Life, probably never professional thou." =)
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, you`ll 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 chunk`s border, which might not be an issue, depending on size of terrain chunk/amount of vegetation and visibility of the footsteps.
i am gonna learn Decals Right Now.! Thank you All For Great Answers.it was just the information That i was looking for !

This topic is closed to new replies.

Advertisement