Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 318 Intro to Computer Graphics John C. Hart

Similar presentations


Presentation on theme: "CS 318 Intro to Computer Graphics John C. Hart"— Presentation transcript:

1 CS 318 Intro to Computer Graphics John C. Hart
Parametric Surfaces CS 318 Intro to Computer Graphics John C. Hart

2 Space Curves z x y x y z t t t
Separate into three coordinate functions p(t) = (x(t), y(t), z(t)) x(t) = (1-t)3 x0 + 3t(1-t)2 x1 + 3t2(1-t) x2 + t3 x3 y(t) = (1-t)3 y0 + 3t(1-t)2 y1 + 3t2(1-t) y2 + t3 y3 z(t) = (1-t)3 z0 + 3t(1-t)2 z1 + 3t2(1-t) z2 + t3 z3 Make your own roller-coaster ride Camera position along space curve Look at point is next position along space curve (tangent) Up direction is cross product of vector to next positon with vector to previous position (binormal) x y z t t t

3 p0(t), p1(t), p0(t+Dt), p1(t+Dt)
Extrusion CS418 Two 3-D copies of each 2-D curve p0(t) = (x(t),y(t),0) p1(t) = (x(t),y(t),1) Create a mesh of quads (or tri-strip) p0(t), p1(t), p0(t+Dt), p1(t+Dt)

4 Generalized Cylinder Construct a 2-D profile curve q(s) = (a(s), b(s))
p(t) p(t+Dt) p(t–Dt) T(t) -T(t–Dt) Construct a 2-D profile curve q(s) = (a(s), b(s)) Construct a space curve p(t) = (x(t), y(t), z(t)) Construct a Frenet frame at each point along space curve T(t) = p(t+Dt) – p(t) B(t) = T(t)  -T(t – Dt) N(t) = B(t)  T(t) (all normalized) Plot 2-D curve in (N,B) space gc(s,t) = p(t) + a(s) N(t) + b(s) B(t)

5 Revolution y Construct a 2-D profile curve q(t) = (x(t), y(t))
Rotate about y axis p(s,t) = (x(t) cos 2p s, y(t), x(t) sin 2p s) z x

6 Bezier Patches p02 p00 p01 p03 p12 p10 p11 p13 p22 Bezier patch
Tensor product of two Bezier curves Product of Bernstein polynomials Bernstein interpolation of Bernstein polynomials Works same way for B-splines p20 p23 p21 p31 p32 p30 p33

7 Blossoming Patches Curves: p(t)  p(t,t,t)
Patches: p(s,t)  p(s,s,s;t,t,t) Variables not allowed to cross the semicolon In patches, bilinear interpolation replaces linear interpolation in curves p(000;011) p(001;011) p(111;011) p(011;011) p(001;011) p(011;111) p(000;111) p(111;111) p(01s;00t) p(00s;00t) p(11s;00t) p(01s;01t) p(00s;01t) p(11s;01t) p(01s;11t) p(00s;11t) p(11s;11t) … etc.

8 Knot Insertion [ ] 4 6 8 2 4 6 0 2 4 6 8 10

9 Knot Insertion [ ] 4 6 8 4 5 6 5 6 8 2 4 6 2 4 5 0 2 4 6 8 10

10 Knot Insertion [ ] 4 5 6 5 6 8 2 4 5 0 2 4 6 8 10

11 Loop Knot Insertion 2 3 4 1 2 3 3 4 5 (7 8 9) 0 1 2 4 5 6 (6 7 8)

12 Loop Knot Insertion 2 3 4 1 2 3 3 4 5 (7 8 9) 0 1 2 4 5 6 (6 7 8)

13 Loop Knot Insertion 2 3 4 3 4 5 1 2 3 0 1 2 4 5 6

14 Loop Knot Insertion 2 3 4 3 4 5 1 2 3 0 1 2 4 5 6

15 Loop Knot Insertion 2 3 4 3 4 5 1 2 3 0 1 2 4 5 6

16 Smoothing a Polygon

17 Smoothing a Polygon Add edge midpoints

18 Smoothing a Polygon Add edge midpoints Add struts
Struts connect midpoints of segments from vertices to edge midpoints One strut per vertex

19 Smoothing a Polygon Add edge midpoints Add struts
Struts connect midpoints of segments from vertices to edge midpoints One strut per vertex Add strut midpoints

20 Smoothing a Polygon Add edge midpoints Add struts
Struts connect midpoints of segments from vertices to edge midpoints One strut per vertex Add strut midpoints Connect

21 Smoothing a Polygon Add edge midpoints Add struts
Struts connect midpoints of segments from vertices to edge midpoints One strut per vertex Add strut midpoints Connect Repeat

22 B-Spline Patches Tensor product of two curves
Need to subdivide control points to create four sub-patches Need to generate new control points vertex points (replacing control points) edge points face points

23 Face Points Approximate edge points as midpoint of control points
E = 1/2 p + 1/2 p Face point is midpoint of approximate edge points F = 1/2 E + 1/2 E = 1/4 p + 1/4 p + 1/4 p + 1/4 p

24 Edge Points E2 p0 F1 Face points are midpoints between approx. edge points Approx. edge point is midpoint between control points Actual edge point is midpoint between midpoints between approx edge point and face points E = 1/2 (1/2 (1/2 E0 + 1/2 E1) + 1/2 E1) + 1/2 (1/2 E1 + 1/2 (1/2 E1 + 1/2 E2)) = 1/2 (1/2 F0 + 1/2 (1/2 p0 + 1/2 p1)) + 1/2 (1/2 (1/2 p0 + 1/2 p1) + 1/2 F1) = 1/4 (F0 + p0 + p1 + F1) E F0 E1 E0 p1

25 Vertex Points E2 V2 E0 p2 E3 V0 = 1/4 E0 + 1/2 p0 + 1/4 E1
V = 1/2 (1/2 (1/2 V0 + 1/2 V1) + 1/2 V1)+ 1/2 (1/2 V1 + 1/2 (1/2 V1 + 1/2 V2) = 1/4 (1/4 (F0 + F1 + p0 + p1) + 1/4 (F2 + F3 + p1 + p2) + 2 V1) = 1/4 (1/4 (F0 + F1 + F2 + F3) + 1/4 (p0 + 2 p1 + p2) + 2/4 (E2 + E3 + 2 p1)) = 1/16(F0 + F1 + F2 + F E0 + 2E1 + 2E2 + 2E3 + 4p1) V1 p0 p1 V0 E1 F2 p2 F0 E2 E1 p0 p1 F3 E0 E3 F1

26 Catmull-Clark Subdiv + + n Add new “face” vertex at each face centroid
centroid = average of face’s vertices Add new “edge” vertex at the average of each edge’s endpoints and adjacent face centroids Move each vertex to a new position that is… where n is the valence of the vertex (# of neighboring edges, also # of adjacent faces) 1  ave. adjacent face centroids 2  ave. adjacent edge midpoints (n-3)  current vertex position + + n

27 Example

28 Creases f i+1j = Centroid of polygon ei+1j = (vi + eij)/2
Dart vertex (one sharp edge): vi+1 = (n-2)/n vi + 1/n2 Sj eij + 1/n2 Sj fi+1j Crease vertex (two sharp edges): vi+1 = (eij + 6vi + eik)/8 Corner vertex (three or more sharp edges) vi+1 = vi

29 Another Example

30 Success?


Download ppt "CS 318 Intro to Computer Graphics John C. Hart"

Similar presentations


Ads by Google