Jump to content
  • Advertisement
Sign in to follow this  
Basiror

Bezier Clipping: control points

This topic is 3631 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 am implementing the bezier clipping algorithm atm and I have a little problem to understand the distribution of the control points of the transformed bezier curve. Lets say the degree is n=3 so you get 4 control points The line equation is ax+by+c = d(p) Now I plug this line equation into the bezier function an get d(B(t)) = d(sum {i=0->n} c_i*B_i^n(t)) => d(t) = sum {i=0->n} d(c_i)*B_i^n(t) => d(t) = sum {i=0->n} (a*c_i.x+b*c_i.y+c)*B_i^n(t) => d(t) = sum {i=0->n} d_i*B_i^n(t) Now the Nishita paper states that the coordinates of the control points of the distance function are c_i(i/n,d_i) My question is, how can I explain the first coordinate (i/n) ?? There must be a derivation, unfortunately all the papers I can find don t explain it at all thx in advance

Share this post


Link to post
Share on other sites
Advertisement
The curve that you want to represent in Bézier form is (t,d(t)) and t = sum_{i=0}^n (i/n)B_i^n(t) when 0<=t<=1. I don’t really like to work with series and I will try to give a proof using the de Casteljau algorithm.

I want to prove that if the coefficients of the Bézier curve are i/n then the coefficients in the de Casteljau algorithm are defined by the following formula:

B_i^k(s) = (i + k*s)/n

If this is the case then the point B_0^n on the curve is

B_0^n(s) = (0 + n*s)/n = s

I will prove it by induction. The basic case is B_i^0(s) = i/n = (i + 0*s)/n. I now suppose the formula is correct for k and prove that it works for k+1:

B_i^(k+1)(s) = (1 - s)*(i + k*s)/n + s*(i + 1 + k*s)/n = (i + k*s - i*s - k*s2 + i*s + s + k*s2)/n = (i + (k+1)*s)/n Q.E.D.

EDIT: t and sum_{i=0}^n (i/n)B_i^n(t) are equals for each t and not only in [0,1]. I have previously inserted this restriction because this is usually the only interval considered when working with Bézier curve.

There is a better way to prove that sum_{i=0}^n (i/n)B_i^n(t) = t. Two C^1 functions differ by a constant iff their derivatives are equals.

d/dt t = 1
d/dt sum_{i=0}^n (i/n)B_i^n(t) = sum_{i=0}^{n-1} n((i+1)/n - i/n)B_i^{n-1}(t) = sum_{i=0}^{n-1} B_i^{n-1}(t) = 1

To calculate the constant I evaluate the two functions in 0:

c = 0 - sum_{i=0}^n (i/n)B_i^n(0) = 0

The two functions are equals. Q.E.D.

[Edited by - apatriarca on July 14, 2008 4:05:56 PM]

Share this post


Link to post
Share on other sites
Thx, that really helped me a lot to understand it.


Just a note, the B_i^n(t) in the derivative should be B_i^{n-1}(t)


Share this post


Link to post
Share on other sites
Quote:
Original post by Basiror
Just a note, the B_i^n(t) in the derivative should be B_i^{n-1}(t)

Yes, it was B_i^{n-1}(t). I have changed it in the original post.

Share this post


Link to post
Share on other sites
I did some further research.

The curve type is called " exlicit / non parametric bezier curve " (uniformly distributed x coordinate)

Just for the case that someone is looking for this.

thx

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.

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

Sign me up!