CS184 Section 7
Bezier Curves and De Casteljau's Algorithm
Brandon Wang
March 5, 2012
Material adapted from Fu-Chung Huang.
Brandon Wang
March 5, 2012
Material adapted from Fu-Chung Huang.
In the end, you'll be sending triangles to your GPU to render, so why represent things in this weird format?
Smooth curves. Triangles are jagged, etc. Think of it as a continuous representation of a curve, whereas triangles are a discrete sample. (Demo later)
Calculate f(u) at a specific point u. (Easier to think between 0 and 1)
Split each line at u.
Can't calculate f(u) for all u. That's silly.
Compute a few points, then draw lines between them.
HW4 demo
Dynamic Programming
for i = 0:power p[i][power] = control_points[i] for power = degree-1:0 for i = 0:power p[i][power] = (1-u) * p[i][power+1] + u*p[i+1][power+1] return p[0][0]