Sign in to follow this  
Xarta

Curve type for racing game

Recommended Posts

Xarta    100
Hello,

I recently picked up a project I had to put on hold last year and can use some advice. It's essentially a racing game. I create the track mesh in 3ds max and in addition to exporting the track mesh itself I export a spline that represents the center of the track, the path, which is then curved and interpolated and used for collision detection (vehicle is attached a ray cast to the closest point on the center of the track).

I'm currently using a hermit curve algorithm... well, that's what it should be anyway. The results aren't perfect (not smooth) and rather than trying to get them perfect I'm thinking I may need to use another, better, perhaps even simpler method to interpolate the path. I'm not even sure there's an error in my implementation of the hermit curve function or that it actually functions as it should. Before spending countless minutes perhaps hours to try out different curve types, is there a "best" type of curve to use for racing games and/or my particular situation?

The coins are placed on nodes on the path (actually offset from the path but I'm sure that's not the problem as without the offsets it still has the same "non-smooth" parts) . The light yellow parts in the string of coins (basically where a directional light reflects most) is where it obviously goes wrong. The first screenshot is near the end of the path, which makes me think it's related to my hermit function (non-closed path). But the second screenshot shows what goes on at other segments in the track. Some portions are nearly perfect (good enough) though.
[attachment=2519:hermiterr1.png]

[attachment=2520:hermiterr2.png]

TIA.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this