290 likes | 454 Views
CS32310 - Lecture 02. Reyer Zwiggelaar rrz@aber.ac.uk. In This Lecture. Three-dimensional objects Bezier curves and patches. Representation. Polygonal Constructive solid geometry (CSG) Spatial subdivision techniques Implicit representation Bi-cubic parametric patches.
E N D
CS32310 - Lecture 02 Reyer Zwiggelaar rrz@aber.ac.uk
In This Lecture • Three-dimensional objects • Bezier curves and patches
Representation • Polygonal • Constructive solid geometry (CSG) • Spatial subdivision techniques • Implicit representation • Bi-cubic parametric patches
Parametric Representation • Explicit function • y = f(x) • Implicit function • f(x,y) = 0 • Parametric function • x = fx(u) • y = fy(u)
Parametric Representation • Parametric function • x = fx(u) = V0x(1-u) + V1xu • y = fy(u) = V0y(1-u) + V1yu V1 V0
Bi-cubic Parametric Patches • Advantages • Exact analytical representation • Potential of 3D shape editing • Economical representation • Examples • Bezier curves / patches • B-spline curves / patches (Lecture 3)
Bezier Curves • History • 1960’s Pierre Bezier (Renault): UNISURF • Same time de Casteljau (Citroen)
Bezier Curves • Start and end point located at opposite vertices of parallelepiped • At start point curve tangential to 0x • At end point curve tangential to 0z • Polynomial • Degree one less than number of control points • Degree equal to three most common
Bezier Curves P0 P3 P1 P2
Bezier Curves • Parametric description • u instead of (x,y,z) • 0 <= u <= 1
Bezier Curves • Start and end points • Q(0) = P0 and Q(1) = P3 • Tangent vectors at start and end points • Q’(0) = 3(P1 - P0) • Q’(1) = 3(P2 - P3)
Joining Bezier Curves • Position continuity • Tangential continuity
Rendering Bezier Curves • Calculate for lots of “u” values • Expensive! • How fine to sample? • Equal sampling along curve? • Sub-division approach • Stop when flat with respect to control points
Sub-Dividing Bezier Curves P1 P2 P0 P3
Sub-Dividing Bezier Curves M12 P1 P2 M01 M23 P0 P3
Sub-Dividing Bezier Curves M12 P1 P2 M012 M123 M01 M23 P0 P3
Sub-Dividing Bezier Curves M12 P1 P2 M012 M0123 M123 M01 M23 P0 P3
Sub-Dividing Bezier Curves M12 P1 P2 M012 M0123 M123 M01 M23 P0 P3
Bezier Patches • 16 control points • Only 4 corners might form part of the patch
Joining Bezier Patches • Sharing of common boundary • Boundary point pairs are collinear
Rendering Bezier Patches • Sub-division • Like for rendering Bezier curves • Do first in x-direction and then y-direction • 4x4 goes to 4x7 goes to 7x7 control points
Bezier Patches • Utah teapot • 32 Bezier Patches • About 288 control points • About 500 polygons
In This Lecture • Three-dimensional objects • Bezier curves and patches
In The Next Lecture • Three-dimensional objects • B-spline curves and patches