Fundamentals of Computer Graphics. Lecture 3 Parametric curve and surface. Yong-Jin Liu.

Similar documents
3D Modeling Parametric Curves & Surfaces

Curve and Surface Basics

CS-184: Computer Graphics. Today

Parametric curves. Brian Curless CSE 457 Spring 2016

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

CS-184: Computer Graphics

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

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

Design considerations

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

Bézier Splines. B-Splines. B-Splines. CS 475 / CS 675 Computer Graphics. Lecture 14 : Modelling Curves 3 B-Splines. n i t i 1 t n i. J n,i.

CS 475 / CS Computer Graphics. Modelling Curves 3 - B-Splines

Computer Graphics Curves and Surfaces. Matthias Teschner

2D Spline Curves. CS 4620 Lecture 18

Lecture IV Bézier Curves

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

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

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

2D Spline Curves. CS 4620 Lecture 13

Curves. Computer Graphics CSE 167 Lecture 11

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

Bezier Curves, B-Splines, NURBS

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

Curves and Surfaces 1

Sung-Eui Yoon ( 윤성의 )

COMPUTER AIDED GEOMETRIC DESIGN. Thomas W. Sederberg

08 - Designing Approximating Curves

Shape Modeling. Differential Geometry Primer Smooth Definitions Discrete Theory in a Nutshell. CS 523: Computer Graphics, Spring 2011

Isoparametric Curve of Quadratic F-Bézier Curve

CGT 581 G Geometric Modeling Curves

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

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Intro to Curves Week 4, Lecture 7

Rational Bezier Curves

Intro to Curves Week 1, Lecture 2

Central issues in modelling

Computergrafik. Matthias Zwicker. Herbst 2010

Space deformation Free-form deformation Deformation control Examples: twisting, bending, tapering

A New Class of Quasi-Cubic Trigonometric Bezier Curve and Surfaces

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

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

GL9: Engineering Communications. GL9: CAD techniques. Curves Surfaces Solids Techniques

Remark. Jacobs University Visualization and Computer Graphics Lab : ESM4A - Numerical Methods 331

Information Coding / Computer Graphics, ISY, LiTH. Splines

LECTURE #6. Geometric Modelling for Engineering Applications. Geometric modeling for engineering applications

An introduction to interpolation and splines

Dgp _ lecture 2. Curves

PS Geometric Modeling Homework Assignment Sheet I (Due 20-Oct-2017)

B-spline Curves. Smoother than other curve forms

COMP3421. Global Lighting Part 2: Radiosity

Fathi El-Yafi Project and Software Development Manager Engineering Simulation

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

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

Spline Surfaces, Subdivision Surfaces

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

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

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

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

Introduction to Computer Graphics

Curves and Surfaces Computer Graphics I Lecture 9

Geometric Modeling of Curves

Bezier Curves. An Introduction. Detlef Reimers

Introduction p. 1 What Is Geometric Modeling? p. 1 Computer-aided geometric design Solid modeling Algebraic geometry Computational geometry

Review 1. Richard Koch. April 23, 2005

Parameterization of triangular meshes

Topic 5.1: Line Elements and Scalar Line Integrals. Textbook: Section 16.2

Advanced Modeling 2. Katja Bühler, Andrej Varchola, Eduard Gröller. March 24, x(t) z(t)

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

Computer Graphics Spline and Surfaces

An Introduction to Bezier Curves, B-Splines, and Tensor Product Surfaces with History and Applications

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

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

Name: Date: 1. Match the equation with its graph. Page 1

Parameterization. Michael S. Floater. November 10, 2011

Shape Representation Basic problem We make pictures of things How do we describe those things? Many of those things are shapes Other things include

Need for Parametric Equations

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

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

Advanced Graphics. Beziers, B-splines, and NURBS. Alex Benton, University of Cambridge Supported in part by Google UK, Ltd

CS3621 Midterm Solution (Fall 2005) 150 points

13.472J/1.128J/2.158J/16.940J COMPUTATIONAL GEOMETRY

Curves and Surfaces Computer Graphics I Lecture 10

American International Journal of Research in Science, Technology, Engineering & Mathematics

2Surfaces. Design with Bézier Surfaces

Computer Graphics Splines and Curves

Surface Modeling. Polygon Tables. Types: Generating models: Polygon Surfaces. Polygon surfaces Curved surfaces Volumes. Interactive Procedural

Approximation of 3D-Parametric Functions by Bicubic B-spline Functions

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

The Essentials of CAGD

Shape Control of Cubic H-Bézier Curve by Moving Control Point

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives.

Properties of Blending Functions

Computer Aided Geometric Design

Curves, Surfaces and Recursive Subdivision

Note on Industrial Applications of Hu s Surface Extension Algorithm

Free-Form Deformation (FFD)

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

OUTLINE. Quadratic Bezier Curves Cubic Bezier Curves

A second order algorithm for orthogonal projection onto curves and surfaces

Shape Modeling and Geometry Processing

Transcription:

Fundamentals of Computer Graphics Lecture 3 Parametric curve and surface Yong-Jin Liu liuyongjin@tsinghua.edu.cn

Smooth curve and surface

Design criteria of smooth curve and surface Smooth and continuity Ability to control the local shape Stability Is it easy to draw

Smooth and continuity Regard the curve as the orbit of point changing with its parameter u C( u) y( u) zu ( ) 2 n x( u) a0 a1u a2u anu Regard the differential of one point as the its speed along the orbit, the direction of speed is the tangent direction of this point x( u) a1 2a2u nanu C( u) y( u) z ( u) n1

C n metric of curve smooth Differentiability of function:if parametric curve has continuous derivative until n order at any point in the interval [a, b],i.e. n order continuous differentiable, then the curve is n order parametric continuous in the interval [a, b]. Polynomial curve has infinite order parametric continuous C Polynomial curve of n order p n (x)=a 0 +a 1 x+a 2 x 2 +a n x n

Consider two curves with a common point Differentiability of function:if parametric curve has continuous derivative until n order at any point in the interval [a, b],i.e. n order continuous differentiable, then the curve is n order parametric continuous in the interval [a, b]. C 0 continuous C 1 continuous

C n curve continuity Differentiability of function:if combined parametric curve has continuous derivative until n order at the joint point, it is called C n or n-order parametric continuous. Is there any thing wrong? The same curve can have different parameters. circle: 1 t xt () x( u) cos( u) or 1 t y( u) sin( u) 2t yt () 1 t 2 2 2

Different parameters will get different derivative vector! (0,2) ) (1 ) 2(1, ) (1 4 )) ( ), ( ( (0,1) )) ),cos( sin( ( )) ( ), ( ( 2 2 2 2 2 t t t t t y t x u u u y u x

C(u), u [a, b] C(t), t [0, 1], t u b a a dc( u) dc( t) dt 1 dc( t) 1 C( u) C( t) du dt du b a dt b a

Two continuity definitions Differentiability of function:if combined parametric curve has continuous derivative until n order at the joint,i.e. n order continuous differentiable, such smooth is called C n or n order parametric continuous. Geometry continuity:if the direction of derivative vector of combined curve at the joint is equal, then it is n order geometry continuous, denoted by G n.

If require G 0 or C 0 continuous at the joint, that is to say two curves are continuous at the joint. If require G 1 continuous at the joint,that is to say two curves are G 0 continuous at the joint, and have the common derivative vector P (1)=aQ (0). when a=1,g 1 continuous is also C 1 continuous If require G 2 continuous at the joint,that is to say two curves are G 1 continuous at the joint, and have common curvature vector.

Curvature formula P(1) P (1) Q(0) Q (0) 3 3 P(1) Q(0) This equation can be wrote as : Q a P bp 2 (0) (1) (1) a, b is arbitrary constant. When a=1,b=0,g 2 continuous is also C 2 continuous. P(0) P(t) P(1) Q(0) Q(t) Q(1) Figure 3.1.7 continuous of two curves

Arc length parameterization of curve The same curve can have different parameter If u(s) is a monotonic function,then C(s)=C(u(s)) is a new parameterization about s of the curve Compute the length L(u) of curve C(u) If there exists parameter s, so that L(s)=s, s 0? s = 0 Length L(s) Parameter s Curve C(s)

Arc length parameterization of curve ds Let C( u) du u s C( u) du L( u) 0 u s L s 1 ( ) ( ) dc( s) dc( u( s)) du 1 v( s) C( u) ds du ds C ( u ) vs ( ) 1

Design criteria of smooth curve and surface Smooth and continuity Ability to control the local shape Stability Is it easy to draw

Power based representation of polynomial curve n order polynomial curve C n (u)=a 0 +a 1 u+a 2 u 2 ++a n u n C( u) ( x( u), y( u), z( u)) a u a ( x, y, z ) i i i i C( u) n i0 a a a a u 0 1 1 u u i n i i n i T

See from the aspect of human computer interaction n order polynomial curve C n (u)=a 0 +a 1 u+a 2 u 2 ++a n u n 1 order polynomial curve: a 1 +a 0 a 1 u+a 0 a 0

n order polynomial curve C n (u)=a 0 +a 1 u+a 2 u 2 ++a n u n 2 order polynomial curve: a 2 u 2 +a 1 u+a 0 a 1 a 0 a 2 +a 1 +a 0 2a 2 +a 1 Parabola, ellipse, hyperbola?

n order polynomial curve C n (u)=a 0 +a 1 u+a 2 u 2 ++a n u n 3 order polynomial curve: a 3 u 3 +a 2 u 2 +a 1 u+a 0

Power based representation of polynomial curve n order polynomial curve C n (u)=a 0 +a 1 u+a 2 u 2 ++a n u n The representation and control ability is very bad Bernstein based representation of polynomial curve Beizer curve Bernstien polynomial n C( u) pibi, n( u) i0 n! i Bin, ( u) u (1 u) i!( n i)! ni

f ( u) a a u a u 0 1 2 2 u 2 a 2 p 2 B 2,2 a 0 a 1 u p 0 p 1 1 B 0,2 B 1,2 f ( u) C( u) p B p B p B 0 0,2 1 1,2 2 2,2

Bernstein based representation of polynomial curve have clear geometry meaning n C( u) p B ( u) B ( u) p i i, n i, n i i0 i0 n

Bernstein based representation of polynomial curve Have clear geometry meaning n C( u) p B ( u) B ( u) p, u [0,1] i i, n i, n i i0 i0 Interpolation of endpoints n n C(0) p B (0) p i0 n i0 i i, n 0 C(1) p B (1) p i i, n n n! i ni Bin, ( u) u (1 u), u [0, 1] i!( n i)!

Bernstein based representation of polynomial curve Have clear geometry meaning Why there exists control polygon effect when use Bernstein based representation?

1 order Bezier curve n C( u) B ( u) p B ( u) p B ( u) p i0 i, n i 0,1 0 1,1 1 n! i ni Bin, ( u) u (1 u), u [0, 1] i!( n i)! u=0 u=1

2 order Bezier curve n C( u) B ( u) p B ( u) p B ( u) p B ( u) p i0 i, n i 0,2 0 1,2 1 2,2 2 n! i ni Bin, ( u) u (1 u), u [0, 1] i!( n i)! u=0 u=1

3 order Bezier curve n C( u) B ( u) p B ( u) p B ( u) p B ( u) p B ( u) p i0 i, n i 0,3 0 1,3 1 2,3 2 3,3 3 n! i ni Bin, ( u) u (1 u), u [0, 1] i!( n i)! u=0 u=1

9 order Bezier curve 9 C( u) B ( u) p i0 i, n i n! i ni Bin, ( u) u (1 u), u [0, 1] i!( n i)! u=0 u=1 u=0.5

Properties of Bezier curve and Bernstein base 1. B i,n (u) 0, for all i, n and 0 u 1 2. Partition of unity n i=0b i,n (u) = 1, 0 u 1 3. B 0,n (0) = B n,n (1) = 1 4. B i,n (u) has and only has a maximum value in the interval [0,1], it is at u=i/n 5. Base set {B i,n (u)} is symmetry about u=1/2 n! i ni Bin, ( u) u (1 u), u [0, 1] i!( n i)!

Computation method of Bezier curve Method 1: 9 C( u) B ( u) p i0 i, n n! i ni Bin, ( u) u (1 u), u [0, 1] i!( n i)! Method 2:geometry drawing i

Computation method of Bezier curve Method 2 (geometry drawing, ruler drawing): example 2 order Bezier curve 2 C( u) B ( u) P i0 i,2 i (1 u) P 2 u(1 u) P u P 2 2 0 1 2 (1 u)((1 u) P up ) u((1 u) P up ) 0 1 1 2

2 order Bezier curve 2 C( u) B ( u) P i0 i,2 i (1 u) P 2 u(1 u) P u P 2 2 0 1 2 (1 u)((1 u) P up ) u((1 u) P up ) 0 1 1 2 Is this property general?

Properties of Bezier curve and Bernstein base 6. recursive definition: B i,n (u) = (1u)B i,n1 (u) +ub i1,n1 (u) with B i,n (u) 0, if i < 0 or i > n 7. derivative: B i,n (u) = db i,n (u) /du = n(b i1,n1 (u) B i,n1 (u) ) with B 1,n1 (u) B n,n1 (u) 0 n! i ni Bin, ( u) u (1 u), u [0, 1] i!( n i)!

Denote n order Bezier curve as C n (P 0,,P n ), then we have C n (P 0,,P n )=(1u)C n1 (P 0,,P n-1 )+uc n1 (P 1,,P n )

Geometry drawing algorithm n order Bezier curve has C n (P 0,,P n )=(1u)C n1 (P 0,,P n-1 )+uc n1 (P 1,,P n ) denote P i as P 0,i P k,i (u)=(1u)p k1,i (u)+up k1,i+1 (u) k = 1,,n i = 0,,nk decasteljau algorithm

Smooth curve and surface in 3D space

1D to 2D Regard the curve as the orbit of point changing with its parameter u C( u) y( u) zu ( ) 2 n x( u) a0 a1u a2u anu

Tensor product surface Tensor product surfaces S( u, v) ( x( u, v), y( u, v), z( u, v)) n m i0 j0 f ( u) g ( v) b i j i, j [ f ( u)] [ b ][ g ( v)] T i i, j j Base function Geometry coefficient Point S(u 0, v 0 ) Isoparametric lines C(u) = S(u, v 0 ) and C(v) = S(u 0, v)

Tensor product Bezier surface n m S( u, v) B ( u) B ( v) Point S(u 0, v 0 ) i0 j0 i, n j, m i, j Isoparametric lines C(u) = S(u, v 0 ) and C(v) = S(u 0, v) P

n m S( u, v) B ( u) B ( v) i0 j0 2D Bernstein base P i, n j, m i, j

Computation method of Bezier curve Geometry drawing algorithm decasteljau algorithm

Computation method of Bezier curve decasteljau algorithm n S( u, v) B ( u) B ( v) P i0 j0 i0 m i, n i, n j, m i, j n m Bi, n ( u) Bj, m( v) Pi, j i0 j0 n B ( u) Q i v u

Design criteria of smooth curve and surface Smooth and continuity Ability to control the local shape Stability Is it easy to draw Is Bezier curve perfect?

Beizer curve The representation and control ability of local shape is bad if interpolate many (n+1) discrete point s, then require a high order (n) Bezier curve. How to improve? Splicing many Bezier curve segments n order polynomial curve C n (u)=a 0 +a 1 u+a 2 u 2 ++a n u n

Design of B-spline curve Determine the order of continuity p Determine node vector U = {u 0, u 1,, u m }; Determine a set of control points {P 0, P 1,, P n }; The form of B-spline curve is n C( u) Ni, p( u) i0 P i

B-spline surface Tensor product surface n m S( u, v) N ( u) N ( v) p1 q1 i0 j0 P i, p j, q i, j r1 U {0,,0, u,, u,1,,1} p1 r p1 s1 q1 sq1 p1 V {0,,0, u,, u,1,,1} q1 r n p 1 and s m q 1

Ability of local shape change

Ability of local shape change

The reason is the local scope of basic function P n m S( u, v) N ( u) N ( v) i0 j0 P i, p j, q i, j N ( u) N ( v) [ u, u ) [ v, v ) i, j i, p j, q i i p1 j jq1

Some extensions of NURBS curve and surface Free form deformation (FFD) Subdivision surface

Free deformation of parametric curve and surface (FFD) 1D curve n C( u) Ni, p( u) p1 i0 m1 U {0,,0, u,, u,1,,1} P p1 m p1 i p1 2D surface 3D solid

Free deformation of parametric curve and surface (FFD) 1D curve 2D surface n m S( u, v) N ( u) N ( v) p1 q1 3D solid i0 j0 P i, p j, q i, j r1 U {0,,0, u,, u,1,,1} p1 r p1 s1 q1 sq1 p1 V {0,,0, u,, u,1,,1} q1

Free deformation of parametric curve and surface (FFD) 1D curve 2D surface 3D solid n m l S( u, v, w) N ( u) N ( v) N ( v) P i0 j0 k0 i, p j, q k, r i, j, k o1 U {0,,0, u,, u,1,,1} p1 r p1 p1 p1 s1 V {0,,0, u,, u,1,,1} q1 sq1 q1 q1 t1 W {0,,0, u,, u,1,,1} r1 tr1 r1 r1

Free deformation of parametric curve and surface (FFD) 1D curve 2D surface 3D solid Further expansion?

Free deformation of parametric curve and surface (FFD) 1D curve 2D surface 3D solid Further expansion?

Extended Free Form Deformation

Selective Course Project 6 Try to program the following shape using GDI+:

Tips: The following code constructs a complicated region using two spline curves using namespace Gdiplus; Graphics graphics( pdc->m_hdc ); Pen pen(color::blue, 3); Point point1( 50, 200); Point point2(100, 150); Point point3(160, 180); Point point4(200, 200); Point point5(230, 150); Point point6(220, 50); Point point7(190, 70); Point point8(130, 220); Point curvepoints[8] = {point1, point2, point3, point4, point5, point6, point7, point8}; Point* pcurvepoints = curvepoints; GraphicsPath path; path.addclosedcurve(curvepoints, 8, 0.5); PathGradientBrush pthgrbrush(&path); pthgrbrush.setcentercolor(color(255, 0, 0, 255)); Color colors[] = {Color(0, 0, 0, 255)}; INT count = 1; pthgrbrush.setsurroundcolors(colors, &count); graphics.drawclosedcurve(&pen, curvepoints, 8, 0.5); graphics.fillpath(&pthgrbrush, &path);