Friday, March 18, 2011

Cubic Interpolation

I have been working on a new waypoint system. The old one which actually used "points" did not work out for smooth navigation. For tracks with a curvy street it was necessary to place a whole lot of points for every turn, which is bad for a racing game that intends to use many curves. So I read myself into calculating Bézier Curves to create a suitable navigation system and this is what it turned out to be:
The yellow lines ar the tangents for the bezier curve. Every waypoint has four tangents which are connected in this image, that means they work as if the point had two tangents, but it is also possible to disconnect them. The dashed line is the auto calculated middle line of the street.

Then I included this system into the editor:
At the moment I try to make the AI work with the new system.

greetings