Objects 2: Curves & Splines Christian Miller CS Fall 2011

Similar documents
Transforms 3: Projection Christian Miller CS Fall 2011

2D Spline Curves. CS 4620 Lecture 13

2D Spline Curves. CS 4620 Lecture 18

Shading 1: basics Christian Miller CS Fall 2011

Computer Graphics Curves and Surfaces. Matthias Teschner

Information Coding / Computer Graphics, ISY, LiTH. Splines

Nonphotorealism. Christian Miller CS Fall 2011

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

LOD and Occlusion Christian Miller CS Fall 2011

Curves. Computer Graphics CSE 167 Lecture 11

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

Parametric curves. Brian Curless CSE 457 Spring 2016

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

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

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

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

Sung-Eui Yoon ( 윤성의 )

Design considerations

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

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

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

Intro to Curves Week 4, Lecture 7

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

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

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

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Splines. Connecting the Dots

Computergrafik. Matthias Zwicker. Herbst 2010

3D Modeling Parametric Curves & Surfaces

08 - Designing Approximating Curves

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

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

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

Central issues in modelling

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

CS-184: Computer Graphics. Today

Lecture IV Bézier Curves

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

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

Bezier Curves, B-Splines, NURBS

Need for Parametric Equations

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

Curves and Surfaces Computer Graphics I Lecture 9

INF3320 Computer Graphics and Discrete Geometry

A Curve Tutorial for Introductory Computer Graphics

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

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

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

CS-184: Computer Graphics

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

Curves and Surfaces 1

Curves and Surfaces Computer Graphics I Lecture 10

Intro to Curves Week 1, Lecture 2

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

ECE 600, Dr. Farag, Summer 09

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

OUTLINE. Quadratic Bezier Curves Cubic Bezier Curves

Rational Bezier Curves

Connected Minimal Acceleration Trigonometric Curves

(Spline, Bezier, B-Spline)

The Free-form Surface Modelling System

Introduction to Geometry. Computer Graphics CMU /15-662

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.

Mar. 20 Math 2335 sec 001 Spring 2014

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

B-spline Curves. Smoother than other curve forms

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

CGT 581 G Geometric Modeling Curves

Interpolation and Basis Fns

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

COMP3421. Global Lighting Part 2: Radiosity

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

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

Review of Tuesday. ECS 175 Chapter 3: Object Representation

Geometric Modeling of Curves

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

CS354 Computer Graphics Introduction. Qixing Huang Januray 17 8h 2017

Properties of Blending Functions

Subdivision Surfaces

Computational Physics PHYS 420

COMPUTER AIDED GEOMETRIC DESIGN. Thomas W. Sederberg

The Essentials of CAGD

Computer Animation. Rick Parent

Important Properties of B-spline Basis Functions

8 Project # 2: Bézier curves

EECS 487, Fall 2005 Exam 2

An introduction to interpolation and splines

Kochanek-Bartels Cubic Splines (TCB Splines)

Spline Surfaces, Subdivision Surfaces

CS770/870 Spring 2017 Curve Generation

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

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

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

Subdivision overview

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

Curves and Surfaces for Computer-Aided Geometric Design

Transcription:

Objects 2: Curves & Splines Christian Miller CS 354 - Fall 2011

Parametric curves Curves that are defined by an equation and a parameter t Usually t [0, 1], and curve is finite Can be discretized at arbitrary resolution Often defined with the aid of control points Used as modeling primitives

Lerp Linear interpolation looks too harsh We d like something smoother

Lerp Linear interpolation looks too harsh We d like something smoother

Continuity A function is C k continuous on a given interval if its k th derivative exists on that interval C 0 means the function is continuous, but its tangents are not C 1 means tangents are continuous too C 2 means curvature is continuous, etc...

Splines Originally used in drafting and design A flexible piece of wood or metal that is constrained to pass through certain points [WP]

Splines Turns out that the interpolation and smoothness properties of splines can be modeled by piecewise polynomial curves Enforcing some constraints at control points can give C 1 continuity There s a bunch of different types with different properties Cubics are the most common pieces since they minimize accelerations along the curve

Representing cubic curves Matrix representation: take powers of t and multiply them by a matrix Cubic splines require 4 control points

Geometry / basis Generally easier to factor C into two matrices: Geometry matrix (G): contains the control points Basis matrix (M): contains weights for those points

Tangents Derivative w.r.t. t is just the derivative of the polynomial part, multiplied by the rest of the matrices

Lerp by matrix This case is linear, so only use 1 and t

Cubic Hermite curves Cubic curve that interpolates two points Also matches given tangents at those points [RTR]

Deriving cubic Hermite curves

Deriving cubic Hermite curves

Deriving cubic Hermite curves

Hermite basis functions Multiply MH by T(t) to get the basis functions for the control points These determine how each control point contributes to the curve s shape [RTR]

Properties of Hermite curves Smoothly interpolates control points Matches tangents Connecting two end-to-end will be C 1 continuous as long as you set tangents equal Not exactly the most intuitive to use

Cubic Bézier curves The most common splines in graphics Very cool properties Used in Adobe Illustrator and much more [WP]

Matrix representation Geometry matrix contains 4 points (no tangents) Otherwise very similar to Hermite curves

Cubic Bézier basis functions B0 = (1-t) 3 B1 = 3 (1-t) 2 t B2 = 3 (1-t) t 2 B3 = t 3 Bézier basis functions sum to 1 at any t Has a very simple form [RTR]

General Bézier curves Bézier curves can be of any order by generating a basis using Bernstein polynomials: Basis always sums to 1 [DF]

de Casteljau s algorithm Bézier curves have a cool property: they can be evaluated as a sequence of linear interpolations Means we don t have to evaluate or even form the polynomials Lerp between each adjacent pair of points Lerp between those intermediate results Keep repeating until you get just one point

de Casteljau s [DF]

de Casteljau s [DF]

de Casteljau s [DF]

de Casteljau s [DF]

de Casteljau s [DF]

Bézier properties The two exterior points are interpolated The two interior points aren t, but they do define tangents The curve will always stay within the convex hull of its control points Efficient to evaluate thanks to de Casteljau s algorithm

Building splines Once you have some cubic curves, you can put them together piecewise to create splines This will generate a smooth curve from an ordered set of points To evaluate: find out which particular curve you re in, compute t, then evalute the curve

Bézier spline Take each group of 4 points and connect with a Bézier curve Must be careful to match tangents [RTR]

Catmull-Rom spline Given a set of points, estimate tangents by differencing the neighbors of each point, then connect them together with piecewise cubic Hermite curves [DF]

Catmull-rom formula

Catmull-rom spline Interpolates the set of control points C 1 continuous everywhere, local support First and last point must be left unconnected, since we can t compute tangents for them [WP]

B-splines Short for basis spline Works the same way as the others Does not interpolate any points or tangents C 2 continuous everywhere Locally supported I ll skip the derivation...

B-spline formula

Wide basis Each point affects a wide, but finite area [ICG]

What use is that? It s really smooth and locally supported, but doesn t interpolate anything... [ICG]

Multiplicity Repeating a point will cause a one degree loss of continuity In exchange, the spline matches the control points at that degree - 1 3 repetitions = C 0 continuity, points are interpolated 2 repetitions = C 1 continuity, tangents interpolated

Nonuniform B-Splines Up until now, we ve assumed all control points are equally spaced in t That is, each t is in the range of [0, 1] We can relax that restriction and put them an arbitrary nonnegative distance apart, even 0 Squashes or stretches the basis functions, changes speed along the curve

Nonuniform Rational B-Splines A.K.A. NURBS Add a w coordinate, interpolate that as well w acts as a weight for each control point, making it pull the curve towards it more or less General enough to represent any other type of curve, used all the time in modeling software

figures courtesy... Real-Time Rendering, 3rd ed. [RTR] Tomas Akenine-Moller, Eric Haines, Naty Hoffman Mathematics for 3D Game Programming and Computer Graphics, 3rd ed. [M3D] Eric Lengyel Interactive Computer Graphics: A Top-Down Approach Featuring Shader-Based OpenGL, 6th ed. [ICG] Edward Angel, Dave Shreiner Wikipedia [WP] Don Fussell s CS 384G slides, The University of Texas at Austin [DF]