Introduction to Computer Graphics

Similar documents
3D Modeling Parametric Curves & Surfaces. Shandong University Spring 2013

3D Modeling Parametric Curves & Surfaces

Curves and Surfaces Computer Graphics I Lecture 9

Curves and Surfaces 1

Information Coding / Computer Graphics, ISY, LiTH. Splines

Design considerations

Lecture IV Bézier Curves

Curves and Surface I. Angel Ch.10

Curves and Surfaces Computer Graphics I Lecture 10

Know it. Control points. B Spline surfaces. Implicit surfaces

Until now we have worked with flat entities such as lines and flat polygons. Fit well with graphics hardware Mathematically simple

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics

Central issues in modelling

Fall CSCI 420: Computer Graphics. 4.2 Splines. Hao Li.

Computer Graphics Curves and Surfaces. Matthias Teschner

CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Splines. Parameterization of a Curve. Curve Representations. Roller coaster. What Do We Need From Curves in Computer Graphics? Modeling Complex Shapes

OUTLINE. Quadratic Bezier Curves Cubic Bezier Curves

Bezier Curves, B-Splines, NURBS

Curves & Surfaces. MIT EECS 6.837, Durand and Cutler

2D Spline Curves. CS 4620 Lecture 18

Curves D.A. Forsyth, with slides from John Hart

2D Spline Curves. CS 4620 Lecture 13

Computergrafik. Matthias Zwicker. Herbst 2010

Curves. Computer Graphics CSE 167 Lecture 11

The Free-form Surface Modelling System

Intro to Curves Week 4, Lecture 7

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

CS-184: Computer Graphics

CSE 167: Introduction to Computer Graphics Lecture 12: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics 1/15

Parametric curves. Reading. Curves before computers. Mathematical curve representation. CSE 457 Winter Required:

Curve Representation ME761A Instructor in Charge Prof. J. Ramkumar Department of Mechanical Engineering, IIT Kanpur

Sung-Eui Yoon ( 윤성의 )

Intro to Modeling Modeling in 3D

CS337 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics. Bin Sheng Representing Shape 9/20/16 1/15

Parametric curves. Brian Curless CSE 457 Spring 2016

Intro to Curves Week 1, Lecture 2

CSE 167: Introduction to Computer Graphics Lecture #13: Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

Splines. Connecting the Dots

CSE 167: Introduction to Computer Graphics Lecture #11: Bezier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

08 - Designing Approximating Curves

Computer Graphics CS 543 Lecture 13a Curves, Tesselation/Geometry Shaders & Level of Detail

Rendering Curves and Surfaces. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Curves and Surfaces. CS475 / 675, Fall Siddhartha Chaudhuri

(Refer Slide Time: 00:02:24 min)

Curves & Surfaces. Last Time? Progressive Meshes. Selective Refinement. Adjacency Data Structures. Mesh Simplification. Mesh Simplification

Curves and Curved Surfaces. Adapted by FFL from CSE167: Computer Graphics Instructor: Ronen Barzel UCSD, Winter 2006

(Spline, Bezier, B-Spline)

Curves and Surfaces. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd

CS 536 Computer Graphics Intro to Curves Week 1, Lecture 2

Review of Tuesday. ECS 175 Chapter 3: Object Representation

CS-184: Computer Graphics. Today

Computer Graphics. Curves and Surfaces. Hermite/Bezier Curves, (B-)Splines, and NURBS. By Ulf Assarsson

Interactive Graphics. Lecture 9: Introduction to Spline Curves. Interactive Graphics Lecture 9: Slide 1

Curve and Surface Basics

Computer Graphics I Lecture 11

Introduction to Geometry. Computer Graphics CMU /15-662

Spline Notes. Marc Olano University of Maryland, Baltimore County. February 20, 2004

B-spline Curves. Smoother than other curve forms

The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a

Geometric Modeling of Curves

CS130 : Computer Graphics Curves. Tamar Shinar Computer Science & Engineering UC Riverside

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

Spline Curves. Spline Curves. Prof. Dr. Hans Hagen Algorithmic Geometry WS 2013/2014 1

Further Graphics. Bezier Curves and Surfaces. Alex Benton, University of Cambridge Supported in part by Google UK, Ltd

From curves to surfaces. Parametric surfaces and solid modeling. Extrusions. Surfaces of revolution. So far have discussed spline curves in 2D

COMPUTER AIDED GEOMETRIC DESIGN. Thomas W. Sederberg

CGT 581 G Geometric Modeling Curves

For each question, indicate whether the statement is true or false by circling T or F, respectively.

Rational Bezier Curves

An introduction to interpolation and splines

Representing Curves Part II. Foley & Van Dam, Chapter 11

Lecture 25: Bezier Subdivision. And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10

The Essentials of CAGD

Objects 2: Curves & Splines Christian Miller CS Fall 2011

15.10 Curve Interpolation using Uniform Cubic B-Spline Curves. CS Dept, UK

Final Exam CS 184: Foundations of Computer Graphics! page 1 of 12!

On Smooth Bicubic Surfaces from Quad Meshes

Computer Graphics. Unit VI: Curves And Fractals. By Vaishali Kolhe

In this course we will need a set of techniques to represent curves and surfaces in 2-d and 3-d. Some reasons for this include

Computer Graphics Splines and Curves

3D Modeling techniques

Homework #2. Shading, Projections, Texture Mapping, Ray Tracing, and Bezier Curves

G 2 Interpolation for Polar Surfaces

CS 4620 Final Exam. (a) Is a circle C 0 continuous?

Curves and Surfaces for Computer-Aided Geometric Design

3D Modeling: Surfaces

Shape modeling Modeling technique Shape representation! 3D Graphics Modeling Techniques

Free-Form Deformation and Other Deformation Techniques

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

Surfaces for CAGD. FSP Tutorial. FSP-Seminar, Graz, November

Parameterization. Michael S. Floater. November 10, 2011

Interpolation and Basis Fns

Spline Surfaces, Subdivision Surfaces

Interactive Graphics Using Parametric Equations (Day 2)

MA 323 Geometric Modelling Course Notes: Day 31 Blended and Ruled Surfaces Coons Patches

Dgp _ lecture 2. Curves

Curves and Surfaces 2

Transcription:

Introduction to Computer Graphics 2016 Spring National Cheng Kung University Instructors: Min-Chun Hu 胡敏君 Shih-Chin Weng 翁士欽 ( 西基電腦動畫 )

Data Representation Curves and Surfaces

Limitations of Polygons Inherently an approximation Planar facets and silhouettes Otherwise, it needs a very large numbers of polygons Fixed resolution No natural parameterization Deformation is relatively difficult Hard to extract information like curvature or to keep smoothness Figures from MIT EECS 6.837, Durand and Cutler 3

Subdivision Subdividing a polygon can alleviate the problem of polygonal mesh representation. E.g. Loop s subdivision Split a triangle into four smaller ones. Choose locations of new vertices by weighted average of the original neighbor vertices. 4

Design Criteria How to build an airplane using flexible strips of wood? Desired cross-section curve The approximate curve can be determined by the control/data points. Avoid derivative discontinuity at the join point 5

Representation of Curves and Surface Explicit Representation: = ( ) or = ( ) No guarantee that either form exists for a given curve (e.g., vertical line and circle) Implicit Representation: (, ) = 0 Line: + + + = 0 Circle: + + = 0 Does represent all lines and circles, but difficult to obtain all points on the curve/surface Parametric Representation: Curve: = ( ) = ( ) ( ) ( ) Surface:, =,,, = (, ) (, ) (, ) = : normal direction : the velocity with which the curve is traced out (tangent direction at point p) and = (, ) (, ) (, ) : tangent plane at point p Most flexible and robust form for computer graphics, but not unique 6

Why Parametric Curves? Intended to provide the generality of polygon meshes but with fewer parameters for smooth surfaces Faster to create a curve, and easier to edit an existing curve Easier to animate than polygon meshes Normal vectors and texture coordinates can be easily defined everywhere 7

Parametric Cubic Polynomial Curves We can use polynomial functions to form curves: p = + + + degree of freedom: n+1 cubic polynomial curve: = + + + = Low freedom, but sufficient to produce the desired shape in a small region The problem is how to efficiently find out the coefficient Least square curve fitting: = + + + = + + + = + + + Need 4 points to solve 12 unknowns 8

Least Square Curve Fitting p = + + + Given 4 control points,,, and Assume the 4 points are with equally spaced values u: = 0 = = = + 1 3 = = + 2 3 = = + + + + + + + = = A= 1 0 0 0 1 1 1 1 1 1 nonsingular c= 1 0 0 0 5.5 9 4.5 1 = = 9 22.5 18 4.5 4.5 13.5 13.5 4.5 Interpolating Geometry Matrix = Multimedia Information System Laboratory 2016/03/08 9

Cubic Interpolating Curves Rather than deriving a single interpolating curve of degree m for all the points, derive a set of cubic interpolating curves. If each segment is derived by letting u varying equally over the interval [0,1], then the matrix is the same for each segment. Derivatives at the joint points will not be continuous. 10

Blending Functions = + + + = = = = ( ) ( ) ( ) ( ) Blending Polynomials = = + + + = The polynomials blend together the individual contributions of each control point and enable us to see the effect of a given control point on the entire curve. 11

Blending Functions (Cont.) ( ) = 9 2 1 3 2 3 1 ( ) = 27 2 ( ) = 27 2 2 3 1 3 1 1 ( ) = 9 2 1 3 2 3 12

Bicubic Surface Patch, = = Need 16 control points to solve the 4x4 unknows in the matrix u= 1 = 1 Rather than writing down and solving 16 equations, we consider the curve at = 0 that interpolates,,, and :, 0 = = = Each value of =,, 1 defines a interpolating curve with the similar form 13

Bicubic Surface Patch (Cont.), 0 = = = : inverse of = ( ) = Consider 4 curves at 4 different v values (16 equations), = = Represented in blending functions:, = ( ) ( ) 14

Hermite Curves A Hermite curve is a curve for which the user provides: The endpoints of the curve: = 0 = = = + + + The derivatives of the curve at the endpoints: = 0 = = = + 2 + 3 = = 1 0 0 0 1 1 1 1 0 1 0 0 0 1 2 3 = Hemite Geometry Matrix 1 0 0 0 1 1 1 1 0 1 0 0 0 1 2 3 = = + + + = + 2 + 3 1 0 0 0 0 0 1 0 3 3 2 1 2 2 1 1 = = = 15

Hermite Curves (Cont.) Both the resulting function and the first derivative are continuous over all segments Represented in blending functions: A point on a Hermite curve is obtained by weighted blending each control point and tangent vector. = = = = = 2 3 + 1 2 + 3 2 + Weights of each component 16

Bezier Curves Two control points define endpoints, and two points control the tangents. located at 1/3 of the start tangent vector located at 2/3 of the start tangent vector p1 p0 p'(0) 1/3 p3 p '(1) 1/3 p 2 slope p (0) slope p (1) t 17

Bezier Curves (Cont.) The endsite conditions are the same 0 = = 1 = = + + + = + + + Approximating derivative conditions 0 = 3( ) = 1 = 3 = + 2 + 3 Replacing the original Hermite matrix. 1 0 0 0 3 3 0 0 = = Bezier Geometry Matrix 3 6 3 0 1 3 3 1 = = 18

Bezier Curves (Cont.) Represented in blending functions: A point on a Bezier curve is obtained by weighted blending each control point = = = (1 ) 3 (1 ) 3 (1 ) 19

Examples of Bezier curves 20

Bernstein Polynomials The blending functions of cubic Bezier curves are a special case of the Bernstein polynomials b kd ( u) d! k!( d k)! k d k u (1 u ) These polynomials give the blending polynomials for any degree Bezier form All the zeros are either at u=0 or at u=1 For any degree they all sum to 1: ( ) = 1 They are all between 0 and 1 inside [0,1] 21

Convex Hull Property The properties of the Bernstein polynomials ensure that all Bezier curves lie in the convex hull of their control points 22

Bezier Patch Edge curves are Bezier curves. Any curve of constant u or v is a Bezier curve Each row of 4 control points defines a Bezier curve in u Evaluating each of these curves at the same u provides 4 virtual control points The virtual control points define a Bezier curve in u Evaluating this curve at v gives the point p(u,v) 23

Bezier Patch (Cont.) Bezier curves can be extended to surfaces {from u to (u,v)}. p( u, v) 3 i 0 3 j 0 b i ( u) b j ( v) p ij u T M B PM T B v 0,0 = 0,0 = 3( ) 0,0 = 3( ) 0,0 = 9( + ) Twist at the corner 24

Bezier Patches Interpolates four corner points Convex hull property Watt, 3D Graphics 25

Bezier Surfaces C0 continuity requires aligning boundary curves C1 continuity requires aligning boundary curves and derivatives 26 Watt, 3D Graphics

Bezier Curve Subdivision Subdividing control polylines produces two new control polylines for each half of the curve defines the same curve all control points are closer to the curve Figure from Prof. S.Chenney, Computer Graphics coursenote, Univ. Wisconsin 27

de Casteljau s Algorithm You can find the point on a Bezier curve for any parameter value u by subdivision Eg. u=0.25 = 0.25 28

Bezier Continuity We can make a long curve by concatenating multiple short Bezier curves. How to keep the continuity? 29

Continuity Properties C 0 continuous :curve/surface has no breaks G 1 continuous : tangent at joint has same direction C 1 continuous : tangent at join has same direction and magnitude C n continuous : curve/surface through nth derivative is continuous 30

B splines How to reach both C 2 continuity and local controllability? Slightly loose the endpoint constraints. B splines do not interpolate any of control points. 31

B spline Curves Start with a sequence of control points Select four from middle of sequence (,,, ) Bezier and Hermite goes between and B Spline doesn t interpolate (touch) any of them but approximates the curve by going through and. Multimedia Information System Laboratory Figures from CG lecture note, U. Virginia 2016/03/08 32

B spline Curves (Cont.) 0 = 1 = 1 6 0 = 1 = 1 2 + 4 + Since p = + + + = 0 = = 1 6 0 = = 1 2 + 4 + q(0) q(1) q( ) (0) ( ) (1) 1 = + + + = 1 6 1 = + 2 + 3 = 1 2 + 4 + = = = 1 6 1 4 1 0 3 0 3 0 3 6 3 0 1 3 3 1 = 33

The Blending Weights = + + + = = = = ( ) ( ) ( ) ( ) = = 1 6 1 4 6 + 3 1 + 3 + 3 3 ( ) = 1 and 0 < < 1 in the interval 0 < < 1 The curve must lie in the convex hull 34

The Blending Weights (Cont.) Multimedia Information System Laboratory Figures from MIT EECS 6.837, Durand and 2016/03/08 Cutler 35

B Spline Surface (Patch) p( u, v) 3 i 0 3 k 0 b ( u) b i j ( v) p ij u T M PM s T S v 36

Applications of Splines and Surfaces Modeling and editing 3D objects. Smooth paths (e.g. camera views) Key frame animation. etc. 37