Splines. Connecting the Dots

Similar documents
Splines, or: Connecting the Dots. Jens Ogniewski Information Coding Group

Information Coding / Computer Graphics, ISY, LiTH. Splines

Computer Graphics Curves and Surfaces. Matthias Teschner

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

Design considerations

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

2D Spline Curves. CS 4620 Lecture 18

08 - Designing Approximating Curves

Lecture IV Bézier Curves

Parametric curves. Brian Curless CSE 457 Spring 2016

3D Modeling Parametric Curves & Surfaces

Curves. Computer Graphics CSE 167 Lecture 11

Central issues in modelling

Rational Bezier Curves

On the Parameterization of Catmull-Rom Curves. Cem Yuksel Scott Schaefer John Keyser Texas A&M University

2D Spline Curves. CS 4620 Lecture 13

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

Curve and Surface Basics

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

Spline Morphing. CG software practical course in the IWR. Carl Friedrich Bolz. Carl Friedrich Bolz

Sung-Eui Yoon ( 윤성의 )

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

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

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

Properties of Blending Functions

Introduction to Computer Graphics

Objects 2: Curves & Splines Christian Miller CS Fall 2011

Curves and Surfaces Computer Graphics I Lecture 9

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

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

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

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

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

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

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

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

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

Bezier Curves, B-Splines, NURBS

MA 323 Geometric Modelling Course Notes: Day 21 Three Dimensional Bezier Curves, Projections and Rational Bezier Curves

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

Advanced Texture-Mapping Curves and Curved Surfaces. Pre-Lecture Business. Texture Modes. Texture Modes. Review quiz

Parametric Surfaces. Michael Kazhdan ( /657) HB , FvDFH 11.2

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

Computer Graphics I Lecture 11

Computer Graphics Splines and Curves

Intro to Curves Week 1, Lecture 2

Curves and Surfaces Computer Graphics I Lecture 10

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

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Review of Tuesday. ECS 175 Chapter 3: Object Representation

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

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

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

Homework #2. Hidden Surfaces, Projections, Shading and Texture, Ray Tracing, and Parametric Curves

Freeform Curves on Spheres of Arbitrary Dimension

Computergrafik. Matthias Zwicker. Herbst 2010

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

Curves & Surfaces. MIT EECS 6.837, Durand and Cutler

Intro to Curves Week 4, Lecture 7

Dgp _ lecture 2. Curves

Approximate Catmull-Clark Patches. Scott Schaefer Charles Loop

Intro to Modeling Modeling in 3D

The Free-form Surface Modelling System

(Spline, Bezier, B-Spline)

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

CS-184: Computer Graphics. Today

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.

MA 323 Geometric Modelling Course Notes: Day 14 Properties of Bezier Curves

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

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

EECS 487, Fall 2005 Exam 2

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

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

B-spline Curves. Smoother than other curve forms

CS-184: Computer Graphics

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

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

Subdivision Surfaces

Parameterization. Michael S. Floater. November 10, 2011

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

On Smooth Bicubic Surfaces from Quad Meshes

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

ECE 600, Dr. Farag, Summer 09

Introduction to Geometry. Computer Graphics CMU /15-662

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

A Practical Review of Uniform B-Splines

The Essentials of CAGD

Computer Graphics Spline and Surfaces

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

Roadmap for tonight. What are Bezier curves (mathematically)? Programming Bezier curves (very high level view).

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

Need for Parametric Equations

On an approach for cubic Bézier interpolation

Curves and Surfaces. Shireen Elhabian and Aly A. Farag University of Louisville

TO DUY ANH SHIP CALCULATION

INF3320 Computer Graphics and Discrete Geometry

Parameterization of triangular meshes

COMPUTER AIDED GEOMETRIC DESIGN. Thomas W. Sederberg

Approximating Catmull-Clark Subdivision Surfaces with Bicubic Patches

Transcription:

Splines or: Connecting the Dots Jens Ogniewski Information Coding Group Linköping University

Before we start... Some parts won t be part of the exam Basically all that is not described in the book. More specific: parameterization schemes, 3-point-spline, change of control points, color interpolation Please feel free to ask questions at any time - via mail or just drop by.

Before we start... Take-aways Good interpolation isn t complicated. The best splines are of course the ones that give you the effect you want, with a minimum of resources.

Overview Characteristics Approximating Splines: Bézier Curves Interpolating Splines: Three-Point-Spline, Catmull-Rom Parameterization

What is a spline A curve build from piecewise function Defined by control-points Historically: a tool to craft smooth curves, used e.g. in ship construction 1/36

Continuity Which grade? Which is the highest grade of derivatives where the curves connect? Parametric continuity vs geometric continuity Short-form: t.ex. C 1, G 2 example: C 0 2/36

Continuity Which grade? Which is the highest grade of derivatives where the curves connect? Parametric continuity vs geometric continuity Short-form: t.ex. C 1, G 2 example: C 1 2/36

Continuity Geometric Continuity Derivative of the functions are vectors If the vector are not the same, but pointing in the same direction, i.e. P (u),0 = kp (u),1, k > 0, the curve is G continuous 3/36

Other characteristics Cardinality Each blending weight is 1 at exactly one control-point, zero at all others, and can be anything in between. Local Control Each control point only influences a a small, finite part of the overall generated curve. Affine invariant The sum of all blending weights is always 1. 4/36

Approximating vs. Interpolating splines Interpolating: passes all its control points. Approximating: passes some of its control points. 5/36

Convex hull Important property: stay inside convex hull of control-points Limits how far the generated curve can stray. 6/36

Which spline for what? Surfaces: Approximating, G 1 or G 2. Movement of objects: interpolating, C 1. Sometimes C 2 needed for acceleration changes. Movement of camera: interpolating, G 2. Color: interpolating, C 1. 7/36

Approximating spline: Bézier Curve Defined by 4 control points, each using its own blending function. 8/36

Approximating spline: Bézier Curve Blending-functions (Bernstein polynomials): BEZ 0,3 = (1 u) 3 BEZ 1,3 = 3u(1 u) 2 BEZ 2,3 = 3u 2 (1 u) BEZ 3,3 = u 3 P u = P 0 (1 u) 3 + P 1 3u(1 u) 2 + P 2 3u 2 (1 u) + P 3 u 3 9/36

Affine Invariant Bézier Curve: Characteristics Continuity Two curve segments with points: P 0,P 1,P 2,P 3 P 3,P 4,P 5,P 6 Derivatives in P3 : 3(P 3 P 2 ) 3( P 3 + P 4 ) C 1 continuous if P 4 = 2P 3 P 2, i.e. P 2,P 3 and P 4 lie on a line and the distance between P 3 and P 4 is the same than between P 2 and P 3 If they lie at least on the line (but the distances are different), the curve is G 1 continuous 10/36

Horner s method Polygon: f (x) = ax 3 + bx 2 + cx + d 3 additions, 6 multiplications Rewrite: f (x) = ((ax + b)x + c)x + d 3 additions, 3 multiplications 11/36

de Casteljau s algorithm Bézier: can be seen as an interpolation of interpolations 12/36

de Casteljau s algorithm Bézier: can be seen as an interpolation of interpolations 12/36

de Casteljau s algorithm Bézier: can be seen as an interpolation of interpolations Can easily chose which interpolation level we want Note however that this heightens the grade of the polynom! 2 levels: linear 3 levels: cubic (e.g. Bernstein polynomials) More than 4 levels not really useful 13/36

Advanced Approximation Splines B-splines: generalization of Bézier curves Non-Uniform Rational B-Spline: generalization of B-Spline Can represent all quadric curves 14/36

Bézier Surfaces Build up from Bézier patches Each patch: 4x4 control points Blending: calculate a 2-dimensional sum P u,v = 4 j=1 4 k=1 BEZ j,3(u)bez k,3(v) P jk Or: first interpolate in x, than in y direction (works in most cases) 15/36

Fitting Bézier Patches Together Start with center point: define point and normal, this spans up a plane corner points: have to lie on this plane, can be chosen freely otherwise line points: interpolated from corner points 16/36

Bézier Surface: Example 17/36

Three-Point-Splines Realtime applications: future points not known Also: lower complexity as Catmull-Rom Calculated from 3 control points, define the curve between the latter two 18/36

Three-Point-Splines 19/36

Cardinal Spline Specified by control points Shape can be varied by a tension parameter t Calculated from 4 control points, define the curve between the middle two Even called Catmull-Rom (for t=0?) 20/36

Cardinal Splines 21/36

Catmull-Rom Spline (α = 0.5) 22/36

Cardinal Spline: centripetal parameterization Problem: distance and tangent depend on the length of each segment Can we do something against that? 1. Find recursive evaluation form 2. Substitute u with u = s P +1 P 0, 0 <= s <= P β +1 P 0 β 23/36

Cardinal Spline: centripetal parameterization Cem Yuksel, Scott Schaefer, John Keyser: Parameterization and applications of Catmull-Rom curves, 2011 24/36

Cardinal Spline: centripetal parameterization s j = P j P j 1 β j slightly less computations, might have higher accuracy 25/36

Change Of Control-Points During Ongoing Interpolation Change of the endpoint of an ongoing interpolation in point P: Using parameterized 3-Point-Spline P 0 = P P+1 = P +1,new, i.e. the new endpoint To maintain C 1 continuity: P = P P 1,new P P 1,new β set β = 0, i.e. use uniform parameterization for this segment, and P 1,new = P P 26/36

Curved PN Triangles Calculate a set of intermediate points from given vertices and normals 27/36

Curved PN Triangles Shape depends on the normals 28/36

Curved PN Triangles Use tangents in equidistant points to project 29/36

Curved PN Triangles Careful: normals can t just be interpolated! 30/36

Color-Interpolation Linear Used by graphics card for texture interpolation Since it treads direction different: visible lines in x and y direction Cubic C 1 continuous Since it uses negative blendweights: can lead to clipping artifacts, discoloring Trigonometric C 1 continuous Based on cosine and since functions Since the GPU has hardware accelerators for that, sine and cosine only take one clock cycle No overshoots or clipping, but ringing artifacts 31/36

Color-Interpolation: Input 32/36

Color-Interpolation: Linear 33/36

Color-Interpolation: Cubic (Catmull-Rom) 34/36

Color-Interpolation: Trigonometric 35/36

Conclusion Splines useful for interpolation of animation, camera parameter, surface generation, color interpolation,... Approximating and Interpolating splines, parameterization (the later will not be included in the exam) Take-aways Good interpolation isn t complicated. The best splines are of course the ones that give you the effect you want, with a minimum of resources. 36/36