Thanks for the answers. The best solution which I found is to do the racing line by hand with a Bezier curve. Never thought that building a racing line would be such a big topic.
I was trying to find the same think and also ended up here.
This is what I got so far. I created two identical paths, but I ajusted the weights for each control point in the second one so it’s more os less proportional to the degree of the curve.
A nice way to find that value is to modulate the weight by the apex angle. It’s inverse, the greater the angle, lower will be the weight:
The result is a very angular and fake racing line. But if we scale all the weights up, if starts to resemble more of a real racing line. Something that I noticed is that if you down do that scaling, the racing line resembles a F1 line. So you can try to scale it up for a more safer feel or scale it down for faster feel.
If the original spline sits on the center of you track, this line will move around it in a way that looks more realistic. But I’m not sure this is an accurate aproximation of the real thing.
Another thing, if you move the position of the second path you can move the path earlier or later. The point of the B-Spline control the properties of the apexis of the curves. Changing their weight and position can help you create the racing line faster.
It depends on the result you are trying to achieve in the asthetics. I’m trying to find a way to rotate the car body to convey the inertia of the car. For me, if it feel fast it’s good, I don’t think people will notice it’s a “bad racing line”
It does most of the things that I talked earlier in the post, now I want to add some controls for an apex offset, so it gets easier to set it earlier or later.