Download presentation
Presentation is loading. Please wait.
Published byAriel Lynn Hubbard Modified over 9 years ago
1
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 30 of 42 Wednesday, 09 April 2008 William H. Hsu Department of Computing and Information Sciences, KSU KSOL course pages: http://snipurl.com/1y5gchttp://snipurl.com/1y5gc Course web site: http://www.kddresearch.org/Courses/CIS636http://www.kddresearch.org/Courses/CIS636 Instructor home page: http://www.cis.ksu.edu/~bhsuhttp://www.cis.ksu.edu/~bhsu Readings: Sections 11.8 – 11.9, Eberly 2 e – see http://snurl.com/1ye72http://snurl.com/1ye72 http://graphics.ucsd.edu/courses/cse167_f06/ Curves 2: Subdivision
2
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Understanding and Using OpenGL EvalMesh/EvalCurve Render a smooth, cubic surface by tessellating it into a set of triangles See: evalMesh*d © 2006 Rotenberg, S., University of California San Diego http://graphics.ucsd.edu/courses/cse167_f06/
3
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics The Curves of Bezier Last week, we talking about drawing straight lines. What if we need to represent a curve of some sort? Use lots of little lines?
4
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics What is a spline? A flexible strip, used to draw a smooth curve through a set of points Can be described with a piecewise polynomial function whose first and second derivatives are continuous across the various sections (that is, slope and acceleration are changing smoothly)
5
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Bezier Curve A sort of friendly spline N control points Blending functions, BEZ(n,k) are the Bernstein Polynomials Curve always passes through first and last control points
6
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Splines in use
7
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Splines in use
8
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Splines in use
9
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Rendering splines
10
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Rendering splines
11
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Method I used: De Casteljau's Algorithm Simple to implement Can use your knowledge of vectors A little bit too much recursion
12
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Main points on Bezier curves We normally use cubic curves (trade-off of control vs. computation time) We can string together lots of curve sections to make what we like Good for drawing Good for animating Understand and be able to implement De Casteljau’s or any other algorithm for plotting Beziers And in 3D…
13
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Today Review Motivation Curves – What's a Spline? – Linear Interpolation – Interpolation Curves vs. Approximation Curves – Bézier – BSpline (NURBS) Surfaces / Patches Subdivision Surfaces Procedural Texturing MIT EECS 6.837, Durand and Cutler
14
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Definition: What's a Spline? Smooth curve defined by some control points Moving the control points changes the curve MIT EECS 6.837, Durand and Cutler
15
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Interpolation Curves / Splines MIT EECS 6.837, Durand and Cutler
16
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Linear Interpolation Simplest "curve" between two points MIT EECS 6.837, Durand and Cutler
17
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Interpolation Curves Curve is constrained to pass through all control points Given points P0, P1,... Pn, find lowest degree polynomial which passes through the points MIT EECS 6.837, Durand and Cutler
18
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Interpolation vs. Approximation Curves MIT EECS 6.837, Durand and Cutler
19
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Interpolation vs. Approximation Curves Interpolation Curve –over constrained →lots of (undesirable?) oscillations Approximation Curve –more reasonable? MIT EECS 6.837, Durand and Cutler
20
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Cubic Bézier Curve 4 control points Curve passes through first & last control point Curve is tangent at P0 to (P0-P1) and at P4 to (P4-P3) MIT EECS 6.837, Durand and Cutler
21
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Cubic Bézier Curve de Casteljau's algorithm for constructing Bézier curves MIT EECS 6.837, Durand and Cutler
22
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Cubic Bézier Curve MIT EECS 6.837, Durand and Cutler
23
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Connecting Cubic Bézier Curves How can we guarantee C0 continuity (no gaps)? How can we guarantee C1 continuity (tangent vectors match)? Asymmetric: Curve goes through some control points but misses others MIT EECS 6.837, Durand and Cutler
24
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Higher-Order Bézier Curves > 4 control points Bernstein Polynomials as the basis functions Every control point affects the entire curve – Not simply a local effect – More difficult to control for modeling Courtesy of Seth Teller. Used with permission. MIT EECS 6.837, Durand and Cutler
25
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Cubic BSplines 4 control points Locally cubic Curve is not constrained to pass through anycontrol points MIT EECS 6.837, Durand and Cutler
26
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Cubic BSplines Iterative method for constructing BSplines Shirley, Fundamentals of Computer Graphics Courtesy of Seth Teller. Used with permission. MIT EECS 6.837, Durand and Cutler
27
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Cubic BSplines MIT EECS 6.837, Durand and Cutler
28
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Cubic BSplines can be chained together better control locally (windowing) MIT EECS 6.837, Durand and Cutler
29
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Bézier is not the same as BSpline Relationship to the control points is different MIT EECS 6.837, Durand and Cutler
30
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Bézier is not the same as BSpline But we can convert between the curves using the basis functions: MIT EECS 6.837, Durand and Cutler
31
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics NURBS (generalized BSplines) BSpline: uniform cubic BSpline NURBS: Non-Uniform Rational BSpline – non-uniform = different spacing between the blending functions, a.k.a. knots – rational = ratio of polynomials (instead of cubic) MIT EECS 6.837, Durand and Cutler
32
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Questions? MIT EECS 6.837, Durand and Cutler
33
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Today Review Motivation Spline Curves Spline Surfaces / Patches – Tensor Product – Bilinear Patches – Bezier Patches Subdivision Surfaces Procedural Texturing MIT EECS 6.837, Durand and Cutler
34
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Tensor Product Of two vectors: Similarly, we can define a surface as the tensor product of two curves.... MIT EECS 6.837, Durand and Cutler
35
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Bilinear Patch MIT EECS 6.837, Durand and Cutler
36
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Bilinear Patch Smooth version of quadrilateral with non-planar vertices... – But will this help us model smooth surfaces? – Do we have control of the derivative at theedges? MIT EECS 6.837, Durand and Cutler
37
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Bicubic Bezier Patch MIT EECS 6.837, Durand and Cutler
38
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Trimming Curves for Patches MIT EECS 6.837, Durand and Cutler
39
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Questions? MIT EECS 6.837, Durand and Cutler
40
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Review Motivation Spline Curves Spline Surfaces / Patches Subdivision Surfaces Procedural Texturing Today MIT EECS 6.837, Durand and Cutler
41
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Chaikin's Algorithm MIT EECS 6.837, Durand and Cutler
42
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Doo-Sabin Subdivision MIT EECS 6.837, Durand and Cutler
43
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Doo-Sabin Subdivision
44
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Loop Subdivision MIT EECS 6.837, Durand and Cutler
45
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Loop Subdivision Some edges can be specified as crease edges Image removed due to copyright considerations http://grail.cs.washington.edu/projects/subdivision/ MIT EECS 6.837, Durand and Cutler
46
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Weird Subdivision Surface Models MIT EECS 6.837, Durand and Cutler
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.