So the aproach I', creating my track at the moment is simmilar to 3d lofting, the track is a list of Segments, each segment has sideA, sideB and a center node.
?I created an AI algorythm that almost mimics the racing line behaviour, but at straights it centers to the track which is not that "ideal". So I figured why not add an ideal line node to the segmet aswell, so the AI can actually follow these points.
?In real life I know how a raceline is formed, but I would like to create a script that auto populates these "ideal nodes". So ideas are welcome.
?Here's an image of showing what I'm after.
So according to the image, to draw the racing line, it needs to start from the outside of the track, go inside near apex and exit outside again. I've got a feeling that this is achievable with a DotProduct trick. Am I right?