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

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

OUTLINE. Quadratic Bezier Curves Cubic Bezier Curves

Intro to Modeling Modeling in 3D

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

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

Curves and Surfaces Computer Graphics I Lecture 10

08 - Designing Approximating Curves

Curves and Surfaces Computer Graphics I Lecture 9

Lecture IV Bézier Curves

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

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

Information Coding / Computer Graphics, ISY, LiTH. Splines

Interactive Graphics Using Parametric Equations (Day 2)

Curves and Surfaces 1

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

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

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

EECS 487, Fall 2005 Exam 2

Introduction to Computer Graphics

(Spline, Bezier, B-Spline)

Computer Graphics Curves and Surfaces. Matthias Teschner

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

Ray Casting of Trimmed NURBS Surfaces on the GPU

Central issues in modelling

Review of Tuesday. ECS 175 Chapter 3: Object Representation

Name: Let the Catmull-Rom curve q(u) be defined by the following control points: p 1 = 0, 1 p 2 = 1, 1 p 3 = 1, 0. p 2. p 1.

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

CHAPTER 1 Graphics Systems and Models 3

Curves. Computer Graphics CSE 167 Lecture 11

INF3320 Computer Graphics and Discrete Geometry

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 AIDED GEOMETRIC DESIGN. Thomas W. Sederberg

CS-184: Computer Graphics

Shading II. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

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

Design considerations

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

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

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

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

and the crooked shall be made straight, and the rough ways shall be made smooth; Luke 3:5

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

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

Computergrafik. Matthias Zwicker. Herbst 2010

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

Computer Graphics I Lecture 11

A MATRIX FORMULATION OF THE CUBIC BÉZIER CURVE

3D Modeling Parametric Curves & Surfaces

09 - Designing Surfaces. CSCI-GA Computer Graphics - Fall 16 - Daniele Panozzo

Supplement to Lecture 16

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

B-spline Curves. Smoother than other curve forms

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

CS452/552; EE465/505. Color Display Issues

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

The Free-form Surface Modelling System

CS559 Computer Graphics Fall 2015

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

Sung-Eui Yoon ( 윤성의 )

Curve Construction via Local Fitting

Properties of Blending Functions

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

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

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

Rational Bezier Curves

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

ECE 600, Dr. Farag, Summer 09

Computer Graphics Splines and Curves

Computer Graphics 1. Chapter 2 (May 19th, 2011, 2-4pm): 3D Modeling. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2011

Spline Functions on Triangulations

Real time Ray-Casting of Algebraic Surfaces

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

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

Rendering the Teapot 1

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

Curve and Surface Basics

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

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.

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

Subdivision Surfaces

Curves, Surfaces and Recursive Subdivision

Chapter 4-3D Modeling

Need for Parametric Equations

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

Objectives. Shading II. Distance Terms. The Phong Reflection Model

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

Subdivision curves and surfaces. Brian Curless CSE 557 Fall 2015

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

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

Technical Report. Removing polar rendering artifacts in subdivision surfaces. Ursula H. Augsdörfer, Neil A. Dodgson, Malcolm A. Sabin.

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

Curves and Surface I. Angel Ch.10

An introduction to interpolation and splines

Splines. Connecting the Dots

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

2D Spline Curves. CS 4620 Lecture 18

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

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

Introduction to Computer Graphics with WebGL

Transcription:

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

Objectives Introduce methods to draw curves - Approximate with lines - Finite Differences Derive the recursive method for evaluation of Bezier curves and surfaces Learn how to convert all polynomial data to data for Bezier polynomials 2

Evaluating Polynomials 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 +u(c 1 +u(c 2 +uc 3 )) - 3 multiplications/evaluation for cubic 3

Finite Differences For equally spaced {u k } we define finite differences () p ( uk) = p( uk) " (1) p ( uk) = p( uk + 1 ) p( uk) # ( m + 1) p( uk) = ( m) p( uk + 1 ) " ( m) p( uk) For a polynomial of degree n, the n th finite difference is constant 4

p(u)=1+3u+2u 2 +u 3 Building a Finite Difference Table 5

Finding the Next Values Starting at the bottom, we can work up generating new values for the polynomial 6

decasteljau Recursion We can use the convex hull property of Bezier 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 Bezier polynomial for properly chosen control data 7

Splitting a Cubic Bezier p, 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) 8

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, l 1, l 2, l 3 } and {r, r 1, r 2, r 3 } that determine them 9

Convex Hulls {l, l 1, l 2, l 3 } and {r, r 1, r 2, r 3 }each have a convex hull that that is closer to p(u) than the convex hull of {p, p 1, p 2, p 3 } This is known as the variation diminishing property. The polyline from l to l 3 (= r ) to r 3 is an approximation to p(u). Repeating recursively we get better approximations. 1

Equations Start with Bezier equations p(u)=u T M B p l(u) must interpolate p() and p(1/2) l() = l = p l(1) = l 3 = p(1/2) = 1/8( p +3 p 1 +3 p 2 + p 3 ) Matching slopes, taking into account that l(u) and r(u) only go over half the distance as p(u) l () = 3(l 1 - l ) = p () = 3/2(p 1 - p ) l (1) = 3(l 3 l 2 ) = p (1/2) = 3/8(- p - p 1 + p 2 + p 3 ) Symmetric equations hold for r(u) 11

Efficient Form l = p r 3 = p 3 l 1 = ½(p + p 1 ) r 1 = ½(p 2 + p 3 ) l 2 = ½(l 1 + ½( p 1 + p 2 )) r 1 = ½(r 2 + ½( p 1 + p 2 )) l 3 = r = ½(l 2 + r 1 ) Requires only shifts and adds 12

Every Curve is a Bezier 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 p(u)=u T M I q There exist Bezier control points p such that p(u)=u T M B p Equating and solving, we find p=m B -1 M I 13

14 Matrices Interpolating to Bezier B-Spline to Bezier " # $ $ $ $ $ $ % & ' ' ' ' = ' 1 6 5 3 2 3 3 1 3 1 2 3 3 6 5 1 1 M M I B " # $ $ $ $ % & = ' 1 4 1 4 2 2 4 1 4 1 1 M M S B

Example These three curves were all generated from the same original data using Bezier recursion by converting all control point data to Bezier control points Bezier Interpolating B Spline 15

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) First subdivide in u - Process creates new points - Some of the original points are discarded original and discarded original and kept new 16

Second Subdivision 16 final points for 1 of 4 patches created 17

Normals For rendering we need the normals if we want to shade - Can compute from parametric equations n = p( u, v) p( u, v) " u v - Can use vertices of corner points to determine - OpenGL can compute automatically 18

Utah Teapot Most famous data set in computer graphics Widely available as a list of 36 3D vertices and the indices that define 32 Bezier patches 19

Quadrics Any quadric can be written as the quadratic form p T Ap+b T p+c= where p=[x, y, z] T with A, b and c giving the coefficients Render by ray casting - Intersect with parametric ray p(α)=p +αd that passes through a pixel - Yields a scalar quadratic equation No solution: ray misses quadric One solution: ray tangent to quadric Two solutions: entry and exit points 2