Jump to content
  • Advertisement
Sign in to follow this  
Winegums

Bezier curves (Permutation problem?)

This topic is 4023 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, I've recently tried to impliment bezier curves into an application. I'm ok with fixed length curves, but I want to write a general function that takes a variable number of points. Generating the coordinates on the curve when you know the number of points was straightforward enough, but I've ran into problems with unknown length curves. Applying the general function has been the problem. the value of the point P is multiplied by some value that depends on the number of points, but I'm not sure what the relation between the length of the curve and this value is. eg on the link here: http://en.wikipedia.org/wiki/B%C3%A9zier_curve for N = 5 the points P0 -> P5 are multiplied by 1,5,10,10,5,1 respectivley. How is this calculated? I think someone mentioned permutations to me, but I'm not sure how to apply this.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Winegums
Hi, I've recently tried to impliment bezier curves into an application. I'm ok with fixed length curves, but I want to write a general function that takes a variable number of points. Generating the coordinates on the curve when you know the number of points was straightforward enough, but I've ran into problems with unknown length curves.

Applying the general function has been the problem. the value of the point P is multiplied by some value that depends on the number of points, but I'm not sure what the relation between the length of the curve and this value is.

eg on the link here:

http://en.wikipedia.org/wiki/B%C3%A9zier_curve

for N = 5 the points P0 -> P5 are multiplied by 1,5,10,10,5,1 respectivley. How is this calculated? I think someone mentioned permutations to me, but I'm not sure how to apply this.
IIRC, the pattern of coefficients is the same as that of Pascal's triangle.

If you run into any other problems, I have some code lying around for n-degree Bezier curves that might be a useful reference (and which I'd be happy to post).

Share this post


Link to post
Share on other sites
It's a row of pascal's triangle. I believe it would be N choose whichever number it is. N!/(r!(N-r)!) 5!/0!5! = 1, 5!/(1!4!) = 5, 5!/(2!3!) = 10 etc.

edit: beaten again!

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.

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!