1 Bezier Curves and Surfaces © Jeff Parker, Nov 2009.

Slides:



Advertisements
Similar presentations
Curves Jim Van Verth Essential Math for Games Animation Problem: want to replay stored set of transformations  Generated by.
Advertisements

Lecture Notes #11 Curves and Surfaces II
Computer Graphics (Spring 2008) COMS 4160, Lecture 6: Curves 1
Parametric Curves Ref: 1, 2.
Lecture 10 Curves and Surfaces I
Cubic Curves CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
ICS 415 Computer Graphics Bézier Splines (Chapter 8)
© University of Wisconsin, CS559 Spring 2004
1 Curves and Surfaces. 2 Representation of Curves & Surfaces Polygon Meshes Parametric Cubic Curves Parametric Bi-Cubic Surfaces Quadric Surfaces Specialized.
Bezier Curves and Splines David Eno MAT 499 Fall ‘06.
Lecture 29 of 42 Bezier Curves and Splines Wednesday, 02 April 2008
Informationsteknologi Monday, December 10, 2007Computer Graphics - Class 161 Today’s class Curve fitting Evaluators Surfaces.
2002 by Jim X. Chen:
OpenGL Curves & Surfaces. Where u varies in some domain (say [0,1]). A Bezier surface patch is a vector-valued function of two variables Evaluators A.
1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution.
Bezier and Spline Curves and Surfaces Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Modelling: Curves Week 11, Wed Mar 23
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Curves Week 13, Mon 24 Nov 2003.
Bezier and Spline Curves and Surfaces CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
COEN Computer Graphics I
Curve Surfaces June 4, Examples of Curve Surfaces Spheres The body of a car Almost everything in nature.
Splines III – Bézier Curves
Curve Modeling Bézier Curves
Bresenham’s Algorithm. Line Drawing Reference: Edward Angel’s book: –6 th Ed. Sections 6.8 and 6.9 Assuming: –Clipped (to fall within the window) –2D.
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
19/13/ :20 UML Graphics II Parametric Curves and Surfaces Session 3.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
A D V A N C E D C O M P U T E R G R A P H I C S CMSC 635 January 15, 2013 Spline curves 1/23 Curves and Surfaces.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
(Spline, Bezier, B-Spline)
Introduction to virtual engineering Óbuda University John von Neumann Faculty of Informatics Institute of Intelligent Engineering Systems Lecture 3. Description.
1 Bezier Curves © Jeff Parker, Nov Goal We often wish to draw generate curves Through selection of arbitrary points Smooth (many derivatives)
Introduction to Computer Graphics with WebGL
CS 445 / 645 Introduction to Computer Graphics Lecture 23 Bézier Curves Lecture 23 Bézier Curves.
Bézier Algorithms & Properties Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday, March 3, 2004.
Quadratic Surfaces. SPLINE REPRESENTATIONS a spline is a flexible strip used to produce a smooth curve through a designated set of points. We.
1 Bezier Curves and Surfaces © Jeff Parker, Nov 2011.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CS 445/645 Fall 2001 Splines/Film/Animation. Final Exam Thursday, December 13 th from 7 – 10 p.m. –Room Olsson 011 You may use one sheet of notes (8.5.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS Representation of Curves and Surfaces Graphics.
Bézier Curves & Surfaces Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Monday, March 1, 2004.
Curves: ch 4 of McConnell General problem with constructing curves: how to create curves that are “smooth” CAD problem Curves could be composed of segments.
Rendering Curves and Surfaces Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico 1 Angel:
Parametric Curves & Surfaces
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring.
11/26/02(C) University of Wisconsin Last Time BSplines.
Parametric Curves CS 318 Interactive Computer Graphics John C. Hart.
CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai.
CSCE 441: Keyframe Animation/Smooth Curves (Cont.) Jinxiang Chai.
1 Graphics CSCI 343, Fall 2015 Lecture 34 Curves and Surfaces III.
CSCI480/582 Lecture 10 Chap.2.3 Cubic Splines – B-Splines and NURBS Feb, 13, 2009.
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
Splines Sang Il Park Sejong University. Particle Motion A curve in 3-dimensional space World coordinates.
Foundations of Computer Graphics (Spring 2012) CS 184, Lecture 12: Curves 1
Computing & Information Sciences Kansas State University Lecture 30 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 30 of 42 Wednesday, 09.
Rendering Bezier Curves (1) Evaluate the curve at a fixed set of parameter values and join the points with straight lines Advantage: Very simple Disadvantages:
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
CS552: Computer Graphics Lecture 19: Bezier Curves.
Object Modeling: Curves and Surfaces CEng 477 Introduction to Computer Graphics.
Introduction to Parametric Curve and Surface Modeling.
© University of Wisconsin, CS559 Spring 2004
CS5500 Computer Graphics May 11, 2006
CS 445 / 645 Introduction to Computer Graphics
CSE 167 [Win 17], Lecture 9: Curves 1 Ravi Ramamoorthi
Rendering Curves and Surfaces
© University of Wisconsin, CS559 Spring 2004
UNIT-5 Curves and Surfaces.
CSCE 441: Keyframe Animation/Smooth Curves (Cont.)
Three-Dimensional Object Representation
Introduction to Parametric Curve and Surface Modeling
Presentation transcript:

1 Bezier Curves and Surfaces © Jeff Parker, Nov 2009

2 Review Fill out the course evaluations! We often wish to draw generate curves Through selection of arbitrary points Smooth (many derivatives) Fast to compute Easy to deal with It is hard to get all of these We will talk about some ideas used to achieve some of these

3 History These ideas were developed twice: Pierre Bézier, at Renault Paul de Casteljau, at Citroën Used by people who needed to bend sheet metal or wood to achieve a smooth shape

4 Background Given a set of n points (x i, y i ) we may be able to define a polynomial that goes through each point. Lagrange Polynomial Assumes that we don't have two points with the same x but different ys. As the number of points rises, the curve can start to wobble to hit each mark.

5 Reminder Wrote line segment as weighted sum of endpoints Can view this as the convex sum of two points The curves below lie in [0..1], sum to 1

6 Bezier Curve We write a Bezier as the weighted sum of control points The control points are multiplied by Bernstein polynomials Convex sum of polynomials with values in [0..1] that sum to 1 Each polynomial pulls curve towards it's control point

7 Terminology The Bezier interpolates the first and fourth control point That is, the curve passes through them The middle two control points draw the curve towards them

8 De Casteljau's Method We can compute points on the curve without evaluating polynomials Can use the midpoints, so only need to shift right

9 De Casteljau Let's spell out what this means Notation differs from figure

10 Expand one level

11 Expand last level

12 Recursive Drawing Algorithm We can take four control points Recursively subdivide, just using shifts Get two Beziers, with 7 control points Curve lies inside the convex hull Continue until the convex hull is one pixel wide At each step, subcurves are shorter are much less wide Can make this formal

13 Hermite Polynomial Sometimes we want to avoid sharp corners Can define the slope at the endpoints Hermite Polynomials use a new blending functions to define curve

14 Hermite Polynomial

15 Hermite Polynomial

16 Catmull-Rom We can get a similar effect with Bezier curves One way of auto-generating the right slopes to a set of interpolated points was introduced by Catmull and Rom Idea is to use slope between previous and next point as the slope at the current point. If distance between points is uneven, can overshoot

17 Interactive Websites to try Bill Casselman's Bezier Applet Wikepedia Animation Edward A. Zobel's Animation ve.html POV-Ray Cyclopedia Tutorial Andy Salter's Spline Tutorial Evgeny Demidov's Interactive Tutorial

18 Splines Make everything a central control point (Image is of a traditional spline used in boat building)

19 Basis Functions In terms of the blending polynomials

20 In OpenGL We could evaluate these by hand, given the formulas above. It is simpler to use Evaluators, provided by OpenGL Evaluators provide a way to use polynomial or rational polynomial mapping to produce vertices, normals, texture coordinates, and colors. The val-ues produced by an evaluator are sent to further stages of GL processing just as if they had been presented using glVertex, glNormal, glTexCoord, and glColor commands, except that the generated values do not update the current normal, texture coordinates, or color. All polynomial or rational polynomial splines of any degree (up to the maximum degree supported by the GL implementation) can be described using evaluators. These include almost all splines used in computer graphics: B-splines, Bezier curves, Hermite splines, and so on. (From the man page)

21 Bezier Curve void drawCurve() { int i; GLfloat pts[4][3]; /* Copy the coordinates from balls to array */ for (i = 0; i < 4; i++) { pts[i][0] = (GLfloat)cp[i]->x; pts[i][1] = (GLfloat)wh - (GLfloat)cp[i]->y; pts[i][2] = (GLfloat)0.0; } // Define the evaluator glMap1f(GL_MAP1_VERTEX_3, 0.0, 1.0, 3, 4, &pts[0][0]); /* type, u_min, u_max, stride, num points, points */ glEnable(GL_MAP1_VERTEX_3); setLineColor(); glBegin(GL_LINE_STRIP); for (i = 0; i <= 30; i++) /* Evaluate the curve when u = i/30 */ glEvalCoord1f((GLfloat) i/ 30.0); glEnd();

22 bteapot.c // vertices.h GLfloat vertices[306][3]={{1.4, 0.0, 2.4}, {1.4, , 2.4}, {0.784, -1.4, 2.4}, {0.0, -1.4, 2.4}, {1.3375, 0.0, }, {1.3375, , }, {0.749, , }, {0.0, , }, {1.4375, 0.0, }, {1.4375, , }, {0.805, , },... // patches.h int indices[32][4][4]={{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}, {4, 17, 18, 19, 8, 20, 21, 22, 12, 23, 24, 25, 16, 26, 27, 28}, {19, 29, 30, 31, 22, 32, 33, 34, 25, 35, 36, 37, 28, 38, 39, 40},...

23 bteapot.c /* 32 patches each defined by 16 vertices, arranged in a 4 x 4 array */ /* NOTE: numbering scheme for teapot has vertices labeled from 1 to 306 */ /* remnent of the days of FORTRAN */ #include "patches.h" void display(void) { int i, j, k; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glColor3f(1.0, 1.0, 1.0); glLoadIdentity(); glTranslatef(0.0, 0.0, -10.0); glRotatef(-35.26, 1.0, 0.0, 0.0); glRotatef(-45.0, 0.0, 1.0, 0.0); /* data aligned along z axis, rotate to align with y axis */ glRotatef(-90.0, 1.0,0.0, 0.0);

24 bteapot.c for(k=0;k<32;k++) { glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4, 0, 1, 12, 4, &data[k][0][0][0]); for (j = 0; j <= 8; j++) { glBegin(GL_LINE_STRIP); for (i = 0; i <= 30; i++) glEvalCoord2f((GLfloat)i/30.0, (GLfloat)j/8.0); glEnd(); glBegin(GL_LINE_STRIP); for (i = 0; i <= 30; i++) glEvalCoord2f((GLfloat)j/8.0, (GLfloat)i/30.0); glEnd(); } glFlush(); }