Jump to content
  • Advertisement
Sign in to follow this  
Xarta

Curve type for racing game

This topic is 2584 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!