So I kinda have this working but its not correct because it just averages, so I wanted to know if anyone here has any ideas.

I'm trying to simulate loose dirt compression under the tires of a vehicle to reduce the potential bumpiness of 'chunky' terrain. Currently how I do this is that I have a bounding box shape around my tires, set a little lower so they intersect with the terrain.

Each frame, I (currently) average all of the heights of each point in the terrain that are within the box bounds of that tire, and then set them all to that average. Clearly this won't work in most cases because, for example, if i'm on a hill, the terrain will deform way too much.

One way I thought was to have a max and min amount the points could raise and lower but that still doesn't seem to work properly and sometimes looks more like steps than smooth dirt.

I wanna say that there is probably a bit more to this that what i'm currently doing but I am not sure where to look. Could anyone here shed some light on this subject? Would I benefit any by maybe looking up some smoothing algorith or something similar?


This is a much harder problem than it seems on the surface. Consider what a wheel actually does on a big hill made of dirt. It pulls dirt from the front of the tire to the back and sprays it out. The same is happening on the flat land.

The compression itself is also complex, in that once-compressed land doesn't compress the same amount on future passes. You can simulate the compression easier than you are trying to do. Just lower each vertex and mark it as 'compressed' when the tire touches it, then don't lower it again if it is already compressed. This would work on hills and flats just fine, would look a bit like snow tracks.

The hard part is the spray, which increases with the incline of the hill and needs to take from the front of the tire and move to the back. This would be cumulative and could be combined with the compression itself. However, the specifics of it are probably not going to be easy to do. If you were performing this often enough you could probably get close just by taking height from the vertex/ices from the front of the tire and distributing the height over the vertices behind the tire, more closer to the tire, less in an expanding trapezoid coming out from the tire. Don't do it from below the tire, just in-front to behind, let compression handle the under-side.

You can probably ignore this effect for most flat land, and only apply it to inclines above a certain threshold, defined by what looks right and performs well. If this calculation is too great to perform often enough, you'll end up with stepping like you were seeing in your own model, only probably a little less pronounced.

Combine this with a proper reduction in velocity to match the 'fluidity' of the dirt displacement and you've got a simulation that should be able to produce stuck cars with trenching/digging tires and piles of dirt. Could be really cool looking. I'd use this sparingly, on patches of dirt and not make entire maps out of the stuff.

| improve this answer | |
  • \$\begingroup\$ Thanks for the input! And for the sake of simplicity, we don't plan to implement any sort of flinging dirt. Mainly cause we don't need it for our machine and also the machine is a relatively slow, heavy duty machine. There are certainly times that it may get stuck and would fling dirt, but it's not needed for what we are doing. As for the "is this already compressed?" it turns out we already have density values for each point in the terrain, so i can just allow more compression the lower the density. =-) \$\endgroup\$ – Mungoid Sep 20 '12 at 19:13
  • \$\begingroup\$ @Mungoid in that case use the density value and do the flat compression under the tire I mentioned before. It won't look 100% right on the hills, but you can't make it look right without it spreading out and back, and that's what the flinging dirt thing is modelling inside the real world. \$\endgroup\$ – DampeS8N Sep 20 '12 at 19:36
  • \$\begingroup\$ Yep you are completely right, it doesn't look perfect going up hills but it also doesn't look too bad =-) Thanks! \$\endgroup\$ – Mungoid Sep 21 '12 at 13:42
  • \$\begingroup\$ @Mungoid glad I could help! \$\endgroup\$ – DampeS8N Sep 21 '12 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.