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

Similar documents
OUTLINE. Quadratic Bezier Curves Cubic Bezier Curves

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

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

Curves and Surfaces Computer Graphics I Lecture 9

Curves and Surface I. Angel Ch.10

Curves and Surfaces Computer Graphics I Lecture 10

Curves and Surfaces 1

Intro to Modeling Modeling in 3D

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

CS 4204 Computer Graphics

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

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

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

Bezier Curves, B-Splines, NURBS

3D Modeling Parametric Curves & Surfaces

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

Information Coding / Computer Graphics, ISY, LiTH. Splines

Introduction to Computer Graphics

Computer Graphics Curves and Surfaces. Matthias Teschner

CS-184: Computer Graphics

Design considerations

Intro to Curves Week 4, Lecture 7

2D Spline Curves. CS 4620 Lecture 18

Sung-Eui Yoon ( 윤성의 )

Curves and Surfaces 2

Dgp _ lecture 2. Curves

2D Spline Curves. CS 4620 Lecture 13

Intro to Curves Week 1, Lecture 2

Rational Bezier Curves

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

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

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

The Free-form Surface Modelling System

3D Modeling techniques

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

An introduction to interpolation and splines

B-spline Curves. Smoother than other curve forms

Central issues in modelling

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. Today

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Physically-Based Modeling and Animation. University of Missouri at Columbia

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

08 - Designing Approximating Curves

Computergrafik. Matthias Zwicker. Herbst 2010

Geometric Modeling of Curves

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

Modeling 3D Objects: Part 2

Curves. Computer Graphics CSE 167 Lecture 11

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

Parametric curves. Brian Curless CSE 457 Spring 2016

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

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

Curve and Surface Basics

Computer Graphics Splines and Curves

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

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

Computer Graphics I Lecture 11

EECS 487, Fall 2005 Exam 2

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

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

Picking and Curves Week 6

CHAPTER 1 Graphics Systems and Models 3

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

CS354 Computer Graphics Surface Representation III. Qixing Huang March 5th 2018

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

Approximate Catmull-Clark Patches. Scott Schaefer Charles Loop

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

Subdivision Surfaces

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

Review of Tuesday. ECS 175 Chapter 3: Object Representation

Rational Bezier Surface

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

Objects 2: Curves & Splines Christian Miller CS Fall 2011

Lecture IV Bézier Curves

INF3320 Computer Graphics and Discrete Geometry

Introduction to Geometry. Computer Graphics CMU /15-662

Local Modification of Subdivision Surfaces Based on Curved Mesh

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

Need for Parametric Equations

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

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

COMPUTER AIDED GEOMETRIC DESIGN. Thomas W. Sederberg

Splines Computer Graphics I Lecture 10

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

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

Splines. Connecting the Dots

Subdivision Curves and Surfaces: An Introduction

VALLIAMMAI ENGINEERING COLLEGE

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

Freeform Curves on Spheres of Arbitrary Dimension

Advanced Graphics. Subdivision Surfaces. Alex Benton, University of Cambridge Supported in part by Google UK, Ltd

Subdivision Surfaces

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

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

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

3D Modeling: Surfaces

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

Approximating Catmull-Clark Subdivision Surfaces with Bicubic Patches

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

Transcription:

Curves and surfaces

Escaping Flatland Until now we have worked with flat entities such as lines and flat polygons Fit well with graphics hardware Mathematically simple But the world is not composed of flat entities Need curves and curved surfaces May only have need at the application level Implementation can render them approximately with flat primitives

Modelling with curves

What is a good representation? There are many ways to represent curves and surfaces Want a representation that is Stable Smooth Easy to evaluate Must we interpolate or can we just come close to data?

Explicit representation Most familiar form of curve in 2D y=f(x) Cannot represent all curves Vertical lines Circles Extension to 3D y=f(x), z=g(x) The form z = f(x,y) defines a surface

Implicit representation Two-dimensional curve(s) g(x,y)=0 Much more robust Lines ax+by+c=0 Circles x 2 +y 2 -r 2 =0 In 3D, g(x,y,z)=0 defines a surface Intersect two surface to get a curve In general, we cannot find y for a given x

Parametric curves Separate equation for each spatial variable x=x(u) y=y(u) z=z(u) p(u)=[x(u), y(u), z(u)] T

Parametric lines We can normalize u to be over the interval [0,1] Line connecting two points p 0 and p 1 p(u)=(1-u)p 0 +up 1 Ray from p 0 in the direction d p(u)=p 0 +ud

Parametric surfaces Surfaces require 2 parameters x=x(u,v) y=y(u,v) z=z(u,v)

Normals We can differentiate with respect to u and v to obtain the normal at any point p

Curve segments After normalizing u, each curve is written p(u)=[x(u), y(u), z(u)] T, 0 u 1 In classical numerical methods, we design a single global curve. In computer graphics and CAD, it is often better to design small connected curve segments.

Selecting functions We want functions that can approximate or interpolate known data are easy to evaluate are easy to differentiate are smooth...

Polynomials Easy to evaluate Continuous and differentiable everywhere Must worry about continuity at join points, including continuity of derivatives

Cubic parametric polynomials Polynomials of degree three gives balance between ease of evaluation and flexibility in design Four coefficients to determine for each of x, y and z Seek four independent conditions for various values of u resulting in 4 equations in 4 unknowns for each of x, y and z Conditions are a mixture of continuity requirements at the join points and conditions for fitting the data

Matrix-vector form

Interpolating curve Given four data (control) points p 0, p 1, p 2, p 3. Determine cubic p(u) which passes through them. Must find c 0, c 1, c 2, c 3.

Interpolating equations apply the interpolating conditions at u=0, 1/3, 2/3, 1

Interpolating equations...or in matrix form with p = Ac, where p = [p0 p1 p2 p3] T

Interpolating matrix -The resulting curve is p(u) = u T c = u T M I p, which we can write p(u)=b(u) T p where b(u)=m I Tu. -The polynomials b i (u) are called blending polynomials, where each polynomial is a cubic.

Interpolating blending functions

Multiple segments

Interpolating patch Need 16 conditions to determine the 16 coefficients c ij

Other types of curves and surfaces How can we get around the limitations of the interpolating form Lack of smoothness Discontinuous derivatives at join points We have four conditions (for cubics) that we can apply to each segment Use them other than for interpolation Need only come close to the data

Hermite form Use two interpolating conditions and two derivative conditions per segment. Ensures continuity and first derivative continuity between segments

Hermite equations Interpolating conditions are the same at ends Differentiating, we find Evaluating at endpoints

Hermite matrix Solving, we find c=m H q where M H is the Hermite matrix

Hermite blending polynomials Although these functions are smooth, the Hermite form is not used directly in Computer Graphics and CAD because we usually have control points but not derivatives. However, the Hermite form is the basis of the Bézier form

Parametric and geometric continuity We can require the derivatives of x, y,and z to each be continuous at join points (parametric continuity). Alternatively, we can only require that the tangents of the resulting curve be continuous (geometry continuity) The latter gives more flexibility as we need to satisfy only two conditions rather than three at each join point

Example Here the p and q have the same tangents at the ends of the segment but different derivatives. Generate different Hermite curves. This techniques is used in drawing applications.

Beziér s idea In graphics and CAD, we do not usually have derivative data Bezier suggested using the same 4 data points as with the cubic interpolating curve to approximate the derivatives in the Hermite form

Approximating derivatives

Bézier equations Interpolating conditions are the same p(0) = p 0 = c 0 p(1) = p 3 = c 0 +c 1 +c 2 +c 3 Approximating derivative conditions p (0) = 3(p 1 - p 0 ) = c 0 p (1) = 3(p 3 - p 2 ) = c 1 +2c 2 +3c 3 Solve four linear equations for c=m B p

Bézier matrix

Bézier blending functions Note that all zeros are at 0 and 1 which forces the functions to be smooth over (0,1)

Convex hull property All Bezier curves lie in the convex hull of their control points Hence, even though we do not interpolate all the data, we cannot be too far away

Bézier patches Using same data array P=[p ij ] as with interpolating form

Analysis Although the Bézier form is much better than the interpolating form, we have discontinuous derivatives at join points We need to have another representation to represent curves that even have continuous 2 nd derivatives We need to do more work per segment and use more control points to apply more continuity conditions to each segment

B-splines Basis splines: use the data at p=[p i-2 p i-1 p i p i-1 ] T to define curve only between p i-1 and p i We relax the condition that the curve segments should interpolate any of the control points and we utilize symmetry in approximating the tangents at the joints For cubics, we can have C 2 continuity at join points Three times as much work for curves and nine times as much work for surfaces

Cubic B-Spline

Cubic B-Spline

Blending functions

Splines and basis If we examine the cubic B-spline from the perspective of each control (data) point, each interior point contributes (through the blending functions) to four segments We can rewrite p(u) in terms of the data points as defining the basis functions {B i (u)}

Basis functions In terms of the blending polynomials

B-spline patches

Generalizing Splines We can extend to splines of any degree Data and conditions do not have to given at equally spaced values (the knots) Non-uniform and uniform splines Can have repeated knots Can force spline to interpolate points

NURBS Non-uniform Rational B-Spline curves and surfaces add a fourth variable w to x,y,z Can interpret as weight to give more importance to some control data Can also interpret as moving to homogeneous coordinate Requires a perspective division NURBS act correctly for perspective viewing Quadrics (spheres, cylinders,...) are a special case of NURBS

Rendering Simplest method to render a polynomial curve is to evaluate the polynomial at many points and form an approximating polyline For surfaces we can form an approximating mesh of triangles or quadrilaterals Use Horner s method to evaluate polynomials p(u)=c 0 +u(c 1 +u(c 2 +uc 3 )) 3 multiplications/evaluation for cubic

Recursive subdivision We can use the convex hull property of Bézier curves to obtain an efficient recursive method that does not require any function evaluations Uses only the values at the control points Based on the idea that any polynomial and any part of a polynomial is a Bézier polynomial for properly chosen control data

Splitting a cubic Bézier p 0, p 1, p 2, p 3 determine a cubic Bezier polynomial and its convex hull Consider left half l(u) and right half r(u)

l(u) and r(u) Since l(u) and r(u) are Bezier curves, we should be able to find two sets of control points {l 0, l 1, l 2, l 3 } and {r 0, r 1, r 2, r 3 } that determine them. {l 0, l 1, l 2, l 3 } and {r 0, r 1, r 2, r 3 } each have a convex hull that that is closer to p(u) than the convex hull of {p 0, p 1, p 2, p 3 } Repeating recursively, we get a good approximation

Efficient algorithm

Every curve is a Bézier curve We can render a given polynomial using the recursive method if we find control points for its representation as a Bezier curve Suppose that p(u) is given as an interpolating curve with control points q There exist Bezier control points p such that Equating and solving, we find p=m B -1M I

Matrices Interpolating to Bezier B-spline to Bezier

Surfaces Can apply the recursive method to surfaces if we recall that for a Bezier patch curves of constant u (or v) are Bezier curves in u (or v)

Subdivision surfaces E. Catmull and J. Clark. Recursively generated B-spline surfaces on arbitrary topological meshes. Computer Aided Design, 10(6):350 355, 1978. DeRose, T., Kass, M., and Truong, T. Subdivision surfaces in character animation. In Proceedings of SIGGRAPH '98.

Subdivision surfaces Geri s game, Pixar 1997

Exact evaluation of SDS Stam, J. 1998. Exact evaluation of Catmull-Clark subdivision surfaces at arbitrary parameter values. In Proceedings of SIGGRAPH '98. ACM.

A short note about SIGGRAPH The computer graphics conference A very nice resource for keeping up-todate on developments in computer graphics Relevant links: http://www.siggraph.org/ http://kesen.realtimerendering.com/

To summarize... Curves and surfaces for CG: Parametric representation of curves/surfaces is convenient. Complex objects can be built using curve segments/surface patches. All curves/surfaces presented here are based on 3 rd degree polynomials.