Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

talenos

Following a Bezier Curve

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

I''m trying to implement some code to follow a bezier curve. I can draw the thing with no problem, with the glEvalCoord() function, but I can''t grab the coordinates to translate too. Anyone know the best way to do this or can point me in the right direction? I''ve tried to find a tutorial or something on it, but with no luck. Thanks

Share this post


Link to post
Share on other sites
Advertisement
The basic is this:

Give 3 points that make up the curve (p0, p1, p2) and a parameter t which varies from 0 to 1 (0 being the start of the curve, 1 being the end) any point on the curve can be calculated like so:

P(t) = ((1 - t)^2)*p0 + 2*(1-t)*t*p1 + t^2*p2

note: x^2 = x squared, not x xor 2


Here is an article on rendering bezier surfaces. Before getting to surfaces they talk about bezier curves which should help you out.

Clicky

You will need a gamasutra registration (free)



[edited by - terminate on March 23, 2004 6:40:51 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!