Tire brakes trace on road

Blitz3D Forums/Blitz3D Programming/Tire brakes trace on road

I used a system where I had 2 pivots attached to each rear wheel (but you could use a local t-formed coord system here to remove the need for pivot entities)

I place one pivot at the point where the inside wheel edge contacts the floor, the other at the point where the outside edge contacts the floor. Done for both rear wheels this gives you 4 pivots.

I then created an empty mesh with a single surface with an appropriate material on it, such as a 50% black blend or something, as I wasn't going to texture map the skids, although that's fairly easy to do.

When a skidmark is triggered I added 4 new vertices to the surface at the position of the 4 pivots (call these L1 and L2 for the left wheel, and R1 and R2 for the right wheel) then setup a counter that decreases. Once the counter reaches zero (ie. allowing the car to skid certain distance) I add 4 more verts (L3 and L4, and R3 and R4) and create a quad polygon using L1,L2,L3 and L4, and another polygon using R1,R2,R3 and R4.

I then repeat this process for as long as the skid continues, creating 2 curved polygon skidmarks that roughly follow the path of the 2 wheels.

Varying the counter adjusts the blockiness of the skidmarks - a lower counter adds vertices more often, creating a smoother look but using more verts and polys over a certain distance - balance it to get the right look depending upon how long your skids are and how often they occur, and how close the camera is.

The only tricky bit is telling when a skid starts and ends and therefore creating a new set of start verts for each seperate skid to ensure you don't get big stretched polys across the world. You also need to keep an eye on the number of verts in the new mesh to ensure it doesn't get too high, perhaps removing the verts in order of oldest first or culling them after a certain time.