Sign in to follow this  

how do you draw footsteps on terrain ?

This topic is 3410 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

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


Link to post
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 this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
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, 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.

Share this post


Link to post
Share on other sites

This topic is 3410 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.

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