Jump to content
  • Advertisement
Sign in to follow this  
DayZero

Beizer curves for Pole Position, is it hard?

This topic is 4861 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

Hi, planning a remake on this game shortly. Done some reconning on the knowlege required, found beizer curves suitable for it. Read a nice article here on GameDev on the subject, but it still feels quite hard to implent it for this game. Just wanted to know.. Have you used Beizer curves in your games? Have you done any racecar game that is like Pole Position using Beizer curves? If so --> was it hard to implent? Thank you all. :)

Share this post


Link to post
Share on other sites
Advertisement
Bezier curves are relatively easy to work with in most ways. The one tricky part might be that continuity (smoothness) where the curves join together along the track is not guaranteed; you'll have to enforce this manually or algorithmically in the editor. For this reason you'll probably want to use cubics rather than quadratics.

As for aligning the car with the curve, that should be quite easy - all you really need is the tangent function for the curve. If the track is restricted to a 2d plane, the frame for the car is trivial; if the track is fully 3d and varies in the vertical dimension as well, a fixed-up frame would probably suffice.

I think the hardest part would probably be arc-length parameterization. You'll probably need this, since if you just move your car linearly in parametric space, its speed along the curve won't be consistent. Arc-length parameterization does require a) a good integrator and b) a root finder of some sort. Dave Eberly has some good docs and code for this on his site. This part is the only part I would consider to be at all difficult, and I suppose it's possible that with careful construction of the track you might be able to get by without it.

To disclaim, I've never tried to write a racing game myself, so this is all speculative. But feel free to ask if you need clarification on anything.

Share this post


Link to post
Share on other sites
Thank you very much for your information! Yes cubics seems like the best choice since they have two control points.

Hopefully this project will turn into a nice experience though probably with lots of trial and error. [smile]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!