Curves and Surfaces Computer Graphics I Lecture 10

Similar documents
Curves and Surfaces Computer Graphics I Lecture 9

Polygon Meshes and Implicit Surfaces

Polygon Meshes and Implicit Surfaces

11/1/13. Polygon Meshes and Implicit Surfaces. Shape Representations. Polygon Models in OpenGL. Modeling Complex Shapes

Curves and Surface I. Angel Ch.10

Curves and Surfaces 1

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

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

Information Coding / Computer Graphics, ISY, LiTH. Splines

Curve and Surface Basics

Intro to Modeling Modeling in 3D

Intro to Curves Week 4, Lecture 7

Geometric Modeling of Curves

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

OUTLINE. Quadratic Bezier Curves Cubic Bezier Curves

Design considerations

3D Modeling Parametric Curves & Surfaces

Computer Graphics I Lecture 11

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

Sung-Eui Yoon ( 윤성의 )

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

CS-184: Computer Graphics

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

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

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Intro to Curves Week 1, Lecture 2

Introduction to Computer Graphics

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

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

Computergrafik. Matthias Zwicker. Herbst 2010

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

Bezier Curves, B-Splines, NURBS

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

Spatial Data Structures

The Free-form Surface Modelling System

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

CS-184: Computer Graphics. Today

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

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

Spatial Data Structures

Splines Computer Graphics I Lecture 10

Spatial Data Structures

Rational Bezier Curves

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

Central issues in modelling

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

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

Lecture IV Bézier Curves

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

Computer Graphics Curves and Surfaces. Matthias Teschner

Parametric curves. Brian Curless CSE 457 Spring 2016

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

2D Spline Curves. CS 4620 Lecture 13

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

Chapter 4-3D Modeling

Introduction to Geometry. Computer Graphics CMU /15-662

Curves. Computer Graphics CSE 167 Lecture 11

B-spline Curves. Smoother than other curve forms

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

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. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd

CHAPTER 1 Graphics Systems and Models 3

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

Implicit Surfaces & Solid Representations COS 426

An introduction to interpolation and splines

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

Modeling 3D Objects: Part 2

CS770/870 Spring 2017 Ray Tracing Implementation

The Essentials of CAGD

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

Dgp _ lecture 2. Curves

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

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

Introduction to Computer Graphics. Farhana Bandukwala, PhD Lecture 11: Surfaces

3D Modeling: Surfaces

Visualization Computer Graphics I Lecture 20

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

2D Spline Curves. CS 4620 Lecture 18

Review of Tuesday. ECS 175 Chapter 3: Object Representation

Object representation

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

Geometric Modeling Systems

Interactive Graphics Using Parametric Equations (Day 2)

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

CS3621 Midterm Solution (Fall 2005) 150 points

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

Visualization Computer Graphics I Lecture 20

Height Fields and Contours Scalar Fields Volume Rendering Vector Fields [Angel Ch. 12] April 23, 2002 Frank Pfenning Carnegie Mellon University

EECS 487, Fall 2005 Exam 2

9. Three Dimensional Object Representations

Need for Parametric Equations

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

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

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

Computer Graphics Splines and Curves

3D Modeling techniques

Outline. Properties of Piecewise Linear Interpolations. The de Casteljau Algorithm. Recall: Linear Interpolation

INF3320 Computer Graphics and Discrete Geometry

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

Transcription:

15-462 Computer Graphics I Lecture 10 Curves and Surfaces Parametric Representations Cubic Polynomial Forms Hermite Curves Bezier Curves and Surfaces [Angel 10.1-10.6] September 30, 2003 Doug James Carnegie Mellon University http://www.cs.cmu.edu/~djames/15-462/fall03/

Goals How do we draw surfaces? Approximate with polygons Draw polygons How do we specify a surface? Explicit, implicit, parametric How do we approximate a surface? Interpolation (use only points) Hermite (use points and tangents) Bezier (use points, and more points for tangents) Next lecture: splines, realization in OpenGL 9/30/2003 15-462 Graphics I 2

Explicit Representation Curve in 2D: y = f(x) Curve in 3D: y = f(x), z = g(x) Surface in 3D: z = f(x,y) Problems: How about a vertical line x = c as y = f(x)? Circle y = (r 2 x 2 ) 1/2 two or zero values for x Too dependent on coordinate system Rarely used in computer graphics 9/30/2003 15-462 Graphics I 3

Implicit Representation Curve in 2D: f(x,y) = 0 Line: ax + by + c = 0 Circle: x 2 + y 2 r 2 = 0 Surface in 3d: f(x,y,z) = 0 Plane: ax + by + cz + d = 0 Sphere: x 2 + y 2 + z 2 r 2 = 0 f(x,y,z) can describe 3D object: Inside: f(x,y,z) < 0 Surface: f(x,y,z) = 0 Outside: f(x,y,z) > 0 9/30/2003 15-462 Graphics I 4

What Implicit Functions are Good For X + kv F < 0? F = 0? F > 0? X F(X + kv) = 0 Ray - Surface Intersection Test Inside/Outside Test 9/30/2003 15-462 Graphics I 5

Isosurfaces of Simulated Tornado 9/30/2003 15-462 Graphics I 6

Constructive Solid Geometry (CSG) Generate complex shapes with basic building blocks machine an object - saw parts off, drill holes glue pieces together This is sensible for objects that are actually made that way (human-made, particularly machined objects) 9/30/2003 15-462 Graphics I 7

A CSG Train Brian Wyvill & students, Univ. of Calgary 9/30/2003 15-462 Graphics I 8

CSG: Negative Objects Use point-by-point boolean functions remove a volume by using a negative object e.g. drill a hole by subtracting a cylinder Subtract From To get Inside(BLOCK-CYL) = Inside(BLOCK) And Not(Inside(CYL)) 9/30/2003 15-462 Graphics I 9

CSG 9/30/2003 15-462 Graphics I 10

CSG 9/30/2003 15-462 Graphics I 11

Algebraic Surfaces Special case of implicit representation f(x,y,z) is polynomial in x, y, z Quadrics: degree of polynomial 2 Render more efficiently than arbitrary surfaces Implicit form often used in computer graphics How do we represent curves implicitly? 9/30/2003 15-462 Graphics I 12

Parametric Form for Curves Curves: single parameter u (e.g. time) x = x(u), y = y(u), z = z(u) Circle: x = cos(u), y = sin(u), z = 0 Tangent described by derivative Magnitude is velocity 9/30/2003 15-462 Graphics I 13

Parametric Form for Surfaces Use parameters u and v x = x(u,v), y = y(u,v), z = z(u,v) Describes surface as both u and v vary Partial derivatives describe tangent plane at each point p(u,v) = [x(u,v) y(u,v) z(u,v)] T 9/30/2003 15-462 Graphics I 14

Assessment of Parametric Forms Parameters often have natural meaning Easy to define and calculate Tangent and normal Curves segments (for example, 0 u 1) Surface patches (for example, 0 u,v 1) 9/30/2003 15-462 Graphics I 15

Parametric Polynomial Curves Restrict x(u), y(u), z(u) to be polynomial in u Fix degree n Each c k is a column vector 9/30/2003 15-462 Graphics I 16

Parametric Polynomial Surfaces Restrict x(u,v), y(u,v), z(u,v) to be polynomial of fixed degree n Each c ik is a 3-element column vector Restrict to simple case where 0 u,v 1 9/30/2003 15-462 Graphics I 17

Approximating Surfaces Use parametric polynomial surfaces Important concepts: Join points for segments and patches Control points to interpolate Tangents and smoothness Blending functions to describe interpolation First curves, then surfaces 9/30/2003 15-462 Graphics I 18

Outline Parametric Representations Cubic Polynomial Forms Hermite Curves Bezier Curves and Surfaces 9/30/2003 15-462 Graphics I 19

Cubic Polynomial Form Degree 3 appears to be a useful compromise Curves: Each c k is a column vector [c kx c ky c kz ] T From control information (points, tangents) derive 12 values c kx, c ky, c kz for 0 k 3 These determine cubic polynomial form Later: how to render 9/30/2003 15-462 Graphics I 20

Interpolation by Cubic Polynomials Simplest case, although rarely used Curves: Given 4 control points p 0, p 1, p 2, p 3 All should lie on curve: 12 conditions, 12 unknowns Space 0 u 1 evenly p 0 = p(0), p 1 = p(1/3), p 2 = p(2/3), p 3 = p(1) 9/30/2003 15-462 Graphics I 21

Equations to Determine c k Plug in values for u = 0, 1/3, 2/3, 1 Note: p k and c k are vectors! 9/30/2003 15-462 Graphics I 22

Interpolating Geometry Matrix Invert A to obtain interpolating geometry matrix 9/30/2003 15-462 Graphics I 23

Joining Interpolating Segments Do not solve degree n for n points Divide into overlap sequences of 4 points p 0, p 1, p 2, p 3 then p 3, p 4, p 5, p 6, etc. At join points Will be continuous (C 0 continuity) Derivatives will usually not match (no C 1 continuity) 9/30/2003 15-462 Graphics I 24

Blending Functions Make explicit, how control points contribute Simplest example: straight line with control points p 0 and p 3 p(u) = (1 u) p 0 + u p 3 b 0 (u) = 1 u, b 3 (u) = u 1 b 0 (u) b 3 (u) 1 u 9/30/2003 15-462 Graphics I 25

Blending Polynomials for Interpolation Each blending polynomial is a cubic Solve (see [Angel, p. 427]): 9/30/2003 15-462 Graphics I 26

Cubic Interpolation Patch Bicubic surface patch with 4 4 control points Note: each c ik is 3 column vector (48 unknowns) [Angel, Ch. 10.4.2] 9/30/2003 15-462 Graphics I 27

Outline Parametric Representations Cubic Polynomial Forms Hermite Curves Bezier Curves and Surfaces 9/30/2003 15-462 Graphics I 28

Hermite Curves Another cubic polynomial curve Specify two endpoints and their tangents 9/30/2003 15-462 Graphics I 29

Deriving the Hermite Form As before Calculate derivative Yields 9/30/2003 15-462 Graphics I 30

Summary of Hermite Equations Write in matrix form Remember p k and p k and c k are vectors! Let q = [p 0 p 3 p 0 p 3 ] T and invert to find Hermite geometry matrix M H satisfying 9/30/2003 15-462 Graphics I 31

Blending Functions Explicit Hermite geometry matrix Blending functions for u = [1 u u 2 u 3 ] T 9/30/2003 15-462 Graphics I 32

Join Points for Hermite Curves Match points and tangents (derivatives) Much smoother than point interpolation How to obtain the tangents? Skip Hermite surface patch More widely used: Bezier curves and surfaces 9/30/2003 15-462 Graphics I 33

Parametric Continuity Matching endpoints (C 0 parametric continuity) Matching derivatives (C 1 parametric continuity) 9/30/2003 15-462 Graphics I 34

Geometric Continuity For matching tangents, less is required G 1 geometric continuity Extends to higher derivatives 9/30/2003 15-462 Graphics I 35

Outline Parametric Representations Cubic Polynomial Forms Hermite Curves Bezier Curves and Surfaces 9/30/2003 15-462 Graphics I 36

Bezier Curves Widely used in computer graphics Approximate tangents by using control points 9/30/2003 15-462 Graphics I 37

Equations for Bezier Curves Set up equations for cubic parametric curve Recall: Solve for c k 9/30/2003 15-462 Graphics I 38

Bezier Geometry Matrix Calculate Bezier geometry matrix M B Have C 0 continuity, not C 1 continuity Have C 1 continuity with additional condition 9/30/2003 15-462 Graphics I 39

Blending Polynomials Determine contribution of each control point Smooth blending polynomials 9/30/2003 15-462 Graphics I 40

Convex Hull Property Bezier curve contained entirely in convex hull of control points Determined choice of tangent coefficient (?) 9/30/2003 15-462 Graphics I 41

Bezier Surface Patches Specify Bezier patch with 4 4 control points Bezier curves along the boundary 9/30/2003 15-462 Graphics I 42

Twist Inner points determine twist at corner Flat means p 00, p 10, p 01, p 11 in one plane ( 2 p/ u v)(0,0) = 0 9/30/2003 15-462 Graphics I 43

The Utah Teapot 9/30/2003 15-462 Graphics I 44

The Utah Teapot The Six Platonic Solids (by Jim Arvo and Dave Kirk, from their '87 SIGGRAPH paper Fast Ray Tracing by Ray Classification.) See http://www.sjbaker.org/teapot/ for more history. 9/30/2003 15-462 Graphics I 45

The Utah Teapot 9/30/2003 15-462 Graphics I 46

The teapot is just cubic Bezier patches! 9/30/2003 15-462 Graphics I 47

Summary Parametric Representations Cubic Polynomial Forms Hermite Curves Bezier Curves and Surfaces 9/30/2003 15-462 Graphics I 48

Preview B-Splines: more continuity (C 2 ) Non-uniform B-splines ( heavier points) Non-uniform rational B-splines (NURBS) Rational functions instead of polynomials Based on homogeneous coordinates Rendering and recursive subdivision Curves and surfaces in OpenGL 9/30/2003 15-462 Graphics I 49