Hi there,
i’m again trying to do some skidmarks. The way i tried is the following:
private function drawWithWheels():void
{
var uvPoint1:Point = new Point((wheelRl.raycastInfo.contactPointWS.x+10000)*(1/20000), (22000-(wheelRl.raycastInfo.contactPointWS.z+11000))*(1/22000));
var uvPoint2:Point = new Point((wheelRr.raycastInfo.contactPointWS.x+10000)*(1/20000), (22000-(wheelRr.raycastInfo.contactPointWS.z+11000))*(1/22000));
var tex:BitmapTexture = texture;
var oldData:BitmapData = tex.bitmapData;
var newData:BitmapData = oldData.clone();
uvPoint1.x *= newData.width;
uvPoint1.y *= newData.height;
uvPoint2.x *= newData.width;
uvPoint2.y *= newData.height;
newData.copyPixels(mSkid, mSkid.rect, uvPoint1);
newData.copyPixels(mSkid, mSkid.rect, uvPoint2);
tex.bitmapData = newData;
oldData.dispose();
}
But with this way you always have to change the texture and that isn’t good for speed.
Other ways i think about is trying to write an own shader for this or using flat meshes to put on the road.
What do you think is the best way to do skidmarks? I even got problems withe the UV’s, these method works fine on a plane, but not on a curved road with repeating UV’s
Thanks for answering