Sunteți pe pagina 1din 19

Surfaces

MIT EECS 6.837, Popovi

Polynomial Curves
Bezier, Hermite, Polynomial of degree n Example (cubic Bezier curve)
q T (u ) = (u 3 u 2 b u1 1 3 - 3 3 - 6 3 1) - 3 3 0 1 0 0 ( 1 p1 )1 0(p 2 )1 0(p3 )1 0(p 4 )1

(p1 )2 (p 2 )2 (p3 )2 (p 4 )2

(p1 )3 (p 2 )3 (p3 )3 (p 4 )3
Bi (u ) (pi )j

Or equivalently (see Buss, VII.1)


MIT EECS 6.837, Popovi

q j (u ) =

Splines: Piecewise Curves


Catmull-Rom, B-spline, Interpolate or approximate control points by assembling polynomial curves. Example (Catmull-Rom spline):
Piecewise cubic Interpolates input points p1, p2, , pn. Unlike Bezier, there can be more than four points C1 (tangent line) continuity More details (Buss, VII.15.1)
MIT EECS 6.837, Popovi

Example: Uniform B-spline


Piecewise cubic Approximates input points. Unlike Bezier, there can be more than four points Unlike Camtull-Rom, it does not interpolate C2 (curvature) continuity

Algebraic construction (Buss, VIII.1)

MIT EECS 6.837, Popovi

B-spline: Geometric Construction


equality C2 (curvature) continuity

midpoint

midpoint

midpoint C1 (tangent line) continuity Bezier A Bezier B

MIT EECS 6.837, Popovi

B-spline: Proof
Proof of Bezier C2 continuity via Subdivision/de Casteljau construction

MIT EECS 6.837, Popovi

B-spline
B-spline control points are black squares Control points for two Bezier curves are circles

MIT EECS 6.837, Popovi

Converting between Bzier & BSpline


original control points as Bzier new BSpline control points to match Bzier

new Bzier control points to match BSpline

MIT EECS 6.837, Popovi

original control points as BSpline

Conversion: Analytic Form


From B-spline control points to Bezier control points. Slide Gs as a window of four B-spline points to obtain control points for each Bezier curve.
1 1 0 Gb = 6 0 0 4 1 0 4 2 0 G s 2 4 0 1 4 1

MIT EECS 6.837, Popovi

Surfaces
Swept Surfaces
Surfaces of revolution General surfaces

Tensor-Product Surfaces

MIT EECS 6.837, Popovi

Surfaces of Revolution
Rotate a 2D profile curve around and axis.
q

s(u, q)

q (u )
s(u, q) = R (q)q(u )

MIT EECS 6.837, Popovi

Surface Normal Vectors


Normal vectors are needed for shading
Normal vector perpendicular to tangent plane Tangent plane spanned by partial derivatives So:

s(u, v) s(u, v) r n(u, q) = normalize u v

In the special case of surface of revolution:

r n(u, q) = R(q) normal(q(u))


MIT EECS 6.837, Popovi

General Sweep Surfaces


Trace out surface by moving a profile curve along a trajectory. Orientation options:
Align profile curve with an axis. Align profile curve with a Frenet frame. Analytic form uses a matrix and a trajectory to transform the profile curve:

s(u, v) = M (c(u ))q(u )

MIT EECS 6.837, Popovi

Bezier Tensor Products


Use a 4x4 grid of control pij points to build a surface:
Use the four rows as control points for four Bezier curves: q 0 (u ), q1 (u ), q 2 (u ), q3 (u ) Define a point on the surface s(u,v) by evaluating another Bezier curve (for parameter v) using the four control points defined by for row Bezier curves (for some value u).

MIT EECS 6.837, Popovi

Bezier Tensor Products

s(u , v) = CB(... CB(p 00 , p 01 , p 02 , p 03 , u ), CB(p10 , p11 , p12 , p13 , u ), CB(p 20 , p 21 , p 22 , p 23 , u ), CB(p30 , p31 , p32 , p33 , u ), v)

MIT EECS 6.837, Popovi

Basis Form
Derivation (Buss VII.10)
s(u, v) =

curve basis

Bi (u ) B j (v)pij

i= 0 j = 0

Tensor-product basis by definition of the tensor product: Bij (u , v) = Bi (u ) B j (v)


MIT EECS 6.837, Popovi

surface basis

Matrix Form
First coordinate only:
p 00 ) L ( 1 (s(u, v))1 = (B0 (u ) B1 (u ) B2 (u ) B3 (u )) M O p ( 30 )1 L 3 v 2 v T 1)B bezier P1B bezier v 1 0 ( v ) B (p03 )1 B1 (v) M B (v) 2 (p33 )1 B3 (v)

= (u 3 u 2

u1

MIT EECS 6.837, Popovi

Tensor-Product B-splines
Use a mxm grid of control points. Composed of of many Bezier surface patches. The (k,l) patch:
s kl (u, v) =

N i (u ) N j (v)pij

i= 0 j = 0

MIT EECS 6.837, Popovi

What You Should Know To Do


List definitions and properties of polynomial curves, splines, B-splines, surfaces of revolution, generalized sweep surfaces, tensor-product surfaces. List definitions of C and G continuity and recognize differences visually. Derive analytic expressions for polynomial curves and spline from constraints indicating locations, tangents, and continuity. Evaluate Bezier and B-splines with geometric construction. Display polynomial curves and splines using line segments.
MIT EECS 6.837, Popovi

S-ar putea să vă placă și