Skidmark Scatter Aches
Blitz3D Forums/Blitz3D Programming/Skidmark Scatter Aches
| ||
Hey all, FIRST: Crap I posted in the WRONG forum, lol, meant to go in BLITZ3D Programming. Sorry Tinkering with some code, after butchering other code snipets I found post around here, and got a few questions to the smarter than the rest of us Guru's. 1 - Trying to find a way to make the next created quad start at the last created wuads vert position, in that they are all linked and not spaced out as seperate objects. 2 - If this method is functional enuff to be worth using. 3 - I created a poor mans method of trying to make the next created quad semi match the turn angle of the last, but because they "overlap" if you were to alpha them for better FX then you get that Overlayed darkening of any two quads made next to eachother. I assuming that a fix for problem #1 would resolve this. Here's the Media used: ![]() And the following Code: Any input or corrections would be greatly welcomed and a relief. Topknot ;) |
| ||
Check the tron demo in samples/mak for an example of creating such a mesh on the fly. |
| ||
Thanks, Now here's a greatly chopped down code, only major problem is I can't get the vert alignment to be flat in line with the ground. If you run the code you'll notice it twist as you turn. It's late and I'm sure I'm missing a very noticable item. Anyone care to point it out to me. Or at least describe how to make a quad that's laying flat on the ground plane, meaning vert creation order. ;) Updated Below Hitting W will show the mesh creation problems Topknot ;) |
| ||
Well all was hoping for at least One clue on how to turn this mesh trail flat, are the forums really that dead...? I did manage to add in a feature where you hit space and a Single flat quad is made, but after several hours I still can't see where to change the mesh trail following the box on it's side. The vert's seems right being created at the X & Z points. Updated Code: Just one pointer to assist would be most welcomed. Topknot ;) |
| ||
just having a play, i replaced the two addvertex calls at line 65 with this:TFormPoint -10,0,0,bike,0 AddVertex trail_surf,TFormedX(),TFormedY(),TFormedZ(),0,0 TFormPoint 10,0,0,bike,0 AddVertex trail_surf,TFormedX(),TFormedY(),TFormedZ(),0,0 the tformpoint translates a point on each side of the bike into global coordinates, make the 10's smaller to match the width of your vehicle for texturing you will need to consider how to set the uv texturing coordinates, the u values will be 0 and 1 the v coordinates should increment the distance the vehicle has traveled since the last time you added to the skidmesh and your skid texture will need to be set to wrap so it repeats... |
| ||
Like this ...If move > 0 TFormPoint 1,0,0, Bike, 0 AddVertex trail_surf, TFormedX(), .1, TFormedZ() TFormPoint -1,0,0, Bike, 0 AddVertex trail_surf, TFormedX(), .1 , TFormedZ() AddTriangle trail_surf,trail_vert+2,trail_vert,trail_vert+3 AddTriangle trail_surf,trail_vert+3,trail_vert,trail_vert+1 AddTriangle trail_surf,trail_vert+3,trail_vert,trail_vert+2 AddTriangle trail_surf,trail_vert+1,trail_vert,trail_vert+3 trail_vert = trail_vert + 2 EndIf EDIT ... just like skidracer!! |
| ||
I'm creating skidmarks on the fly in StuntCarRacing - all I've done is create 2 pivots for the inside and outside tyre contact point for each wheel, then when a skidmark is required I just create a new poly between the pivot positions and the last 2 verts used. These new 2 verts' positions are then stored to be used as the last 2 verts for the next new poly. I also use a flagging system so that if the skidmark stops, a flag is set to prevent the 1st poly being created when a new skid is started. This prevents the sudden appearance of a huge stretched poly across the world and means the new skidmark starts neatly. Using pivots as child objects to the vehicle bodymesh means that the skidmarks are always correctly aligned to the ground the car is sitting on, so long as the body is aligned correctly. Ideally I would parent the pivots to the wheel, but this doesn't work if the wheel rotates and thus requires the wheel to be a child object to a wheel-centre pivot, and the skidmarks pivots' would be children of this wheel-centre pivot also. Then you'd rotate the wheel-centre pivot along the steering axis to turn the wheels left and right, which would also move the skidmark pivots, and then spin just the wheel child object around the axle axis to make the wheels visually spin. |
| ||
Thank you all extremely much, It's more than I hoped for: @ skid & Steve, May a 1000 Vestal Virgins take comfort in your touch ;) Finally the blasted mesh is flat ;) @ Vorderman, the part of storing the verts is very interesting, no chance of sharing your method or a faxsimly of such a method? The whole pivot/child thingy is a breeze but the storing of the verts is what would finish this off, cause like you said it creates a mesh between the last places verts and the newly created puppies ;) Again thank you all....if you knew the frsutration this has caused me in the last several hours, and many attempts, not to menthod a pack of cigs used up in the process. Topknot ;) |