© University of Wisconsin, CS559 Spring 2004

Slides:



Advertisements
Similar presentations
Splines I – Curves and Properties
Advertisements

Curves Jim Van Verth Essential Math for Games Animation Problem: want to replay stored set of transformations  Generated by.
Interpolating curves.
Lecture Notes #11 Curves and Surfaces II
Parametric Curves Ref: 1, 2.
2002 by Jim X. Chen: Bezier Curve Bezier Curve.
COMPUTER GRAPHICS CS 482 – FALL 2014 OCTOBER 8, 2014 SPLINES CUBIC CURVES HERMITE CURVES BÉZIER CURVES B-SPLINES BICUBIC SURFACES SUBDIVISION SURFACES.
Geometric Modeling Notes on Curve and Surface Continuity Parts of Mortenson, Farin, Angel, Hill and others.
Cubic Curves CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
Overview June 9- B-Spline Curves June 16- NURBS Curves June 30- B-Spline Surfaces.
© University of Wisconsin, CS559 Spring 2004
B-Spline Blending Functions
1 Introduction Curve Modelling Jack van Wijk TU Eindhoven.
08/30/00 Dinesh Manocha, COMP258 Hermite Curves A mathematical representation as a link between the algebraic & geometric form Defined by specifying the.
1 Curves and Surfaces. 2 Representation of Curves & Surfaces Polygon Meshes Parametric Cubic Curves Parametric Bi-Cubic Surfaces Quadric Surfaces Specialized.
MIT EECS 6.837, Durand and Cutler Curves & Surfaces.
Cornell CS465 Fall 2004 Lecture 16© 2004 Steve Marschner 1 Curved surfaces CS 465 Lecture 16.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lecture 12: Spline Curves (review) Ravi Ramamoorthi Most material.
Modeling of curves Needs a ways of representing curves: Reproducible - the representation should give the same curve every time; Computationally Quick;
Geometric Modeling Surfaces Mortenson Chapter 6 and Angel Chapter 9.
Curves Mortenson Chapter 2-5 and Angel Chapter 9
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.
1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided.
Computer Graphics Lecture 13 Curves and Surfaces I.
Curves and Surfaces (cont’) Amy Zhang. Conversion between Representations  Example: Convert a curve from a cubic B-spline curve to the Bézier form:
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
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.
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
V. Space Curves Types of curves Explicit Implicit Parametric.
Curves.
1 Dr. Scott Schaefer Coons Patches and Gregory Patches.
INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve.
Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
Representation of Curves & Surfaces Prof. Lizhuang Ma Shanghai Jiao Tong University.
04/18/02(c) 2002 University of Wisconsin Last Time Hermite Curves Bezier Curves.
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.
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.
(c) 2002 University of Wisconsin
Designing Parametric Cubic Curves 1. 2 Objectives Introduce types of curves ­Interpolating ­Hermite ­Bezier ­B-spline Analyze their performance.
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
Splines Sang Il Park Sejong University. Particle Motion A curve in 3-dimensional space World coordinates.
College of Computer and Information Science, Northeastern UniversityFebruary 27, CS U540 Computer Graphics Prof. Harriet Fell Spring 2009 Lectures.
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:
SIAM Conference on Geometric Desing & Computing Approximation of spatial data with shape constraints Maria Lucia Sampoli University of Siena, Italy.
CS559: Computer Graphics Lecture 33: Shape Modeling Li Zhang Spring 2008.
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
CS552: Computer Graphics Lecture 19: Bezier Curves.
Piecewise Polynomial Parametric Curves Sun-Jeong Kim.
Object Modeling: Curves and Surfaces CEng 477 Introduction to Computer Graphics.
Introduction to Parametric Curve and Surface Modeling.
COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 SPLINES
© University of Wisconsin, CS559 Spring 2004
Introduction to Parametric Curve and Surface Modeling
Curve & Surface.
Chapter 10-2: Curves.
© University of Wisconsin, CS559 Fall 2004
© University of Wisconsin, CS559 Fall 2004
© University of Wisconsin, CS559 Spring 2004
Implicit Functions Some surfaces can be represented as the vanishing points of functions (defined over 3D space) Places where a function f(x,y,z)=0 Some.
UNIT-5 Curves and Surfaces.
Introduction to Parametric Curve and Surface Modeling
Overview June 9- B-Spline Curves June 16- NURBS Curves
Presentation transcript:

© University of Wisconsin, CS559 Spring 2004 Last Time Introduction to parametric curves Hermite curves Bezier curves Continuity 4/27/04 © University of Wisconsin, CS559 Spring 2004

© University of Wisconsin, CS559 Spring 2004 Today Geometric continuity Parametric surfaces General Tensor product surfaces Bezier surfaces BSplines Homework 7 available, due Thursday May 6 in class 4/27/04 © University of Wisconsin, CS559 Spring 2004

© University of Wisconsin, CS559 Spring 2004 Continuity When two curves are joined, we typically want some degree of continuity across the boundary (the knot) C0, “C-zero”, point-wise continuous, curves share the same point where they join C1, “C-one”, continuous derivatives, curves share the same parametric derivatives where they join C2, “C-two”, continuous second derivatives, curves share the same parametric second derivatives where they join Higher orders possible 4/27/04 © University of Wisconsin, CS559 Spring 2004

© University of Wisconsin, CS559 Spring 2004 Bezier Continuity P0,1 P0,2 P0,0 P1,3 J P1,2 P1,1 Disclaimer: PowerPoint curves are not Bezier curves, they are interpolating piecewise quadratic curves! This diagram is an approximation. 4/27/04 © University of Wisconsin, CS559 Spring 2004

© University of Wisconsin, CS559 Spring 2004 Sketch of Proof for C1 Bezier curve equation: Parametric derivative: Evaluated at endpoint of curve (note proves tangent property): 4/27/04 © University of Wisconsin, CS559 Spring 2004

© University of Wisconsin, CS559 Spring 2004 Proof (cont) P0,1 P0,2 P1,3 P0,0 J P1,2 P1,1 C1 requires equal parametric derivatives: 4/27/04 © University of Wisconsin, CS559 Spring 2004

© University of Wisconsin, CS559 Spring 2004 DOF and Locality The number of degrees of freedom (DOF) can be thought of as the number of things a user gets to specify If we have n piecewise Bezier curves joined with C0 continuity, how many DOF does the user have? If we have n piecewise Bezier curves joined with C1 continuity, how many DOF does the user have? Locality refers to the number of curve segments affected by a change in a control point Local change affects fewer segments How many segments of a piecewise cubic Bezier curve are affected by each control point if the curve has C1 continuity? What about C2? 4/27/04 © University of Wisconsin, CS559 Spring 2004

© University of Wisconsin, CS559 Spring 2004 Geometric Continuity Derivative continuity is important for animation If an object moves along the curve with constant parametric speed, there should be no sudden jump at the knots For other applications, tangent continuity might be enough Requires that the tangents point in the same direction Referred to as G1 geometric continuity Curves could be made C1 with a re-parameterization: u=f(t) The geometric version of C2 is G2, based on curves having the same radius of curvature across the knot What is the tangent continuity constraint for a Bezier curve? 4/27/04 © University of Wisconsin, CS559 Spring 2004

Bezier Geometric Continuity P0,1 P0,2 P0,0 P1,3 J P1,1 P1,2 for some k 4/27/04 © University of Wisconsin, CS559 Spring 2004

© University of Wisconsin, CS559 Spring 2004 Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation x(s,1) s P1,1 P0,1 x(s,t) t P0,0 s x(s,0) P1,0 4/27/04 © University of Wisconsin, CS559 Spring 2004

Tensor Product Surface Patches Defined over a rectangular domain Valid parameter values come from within a rectangular region in parameter space: 0s<1, 0t<1 Use a rectangular grid of control points to specify the surface 4 points in the bi-linear case on the previous slide, more in other cases Surface takes the form: For some functions Fi,s and Fj,t 4/27/04 © University of Wisconsin, CS559 Spring 2004

© University of Wisconsin, CS559 Spring 2004 Bezier Patches As with Bezier curves, Bin(s) and Bjm(t) are the Bernstein polynomials of degree n and m respectively Most frequently, use n=m=3: cubic Bezier patch Need 4x4=16 control points, Pi,j 4/27/04 © University of Wisconsin, CS559 Spring 2004

© University of Wisconsin, CS559 Spring 2004 Bezier Patches (2) Edge curves are Bezier curves Any curve of constant s or t is a Bezier curve One way to think about it: Each row of 4 control points defines a Bezier curve in s Evaluating each of these curves at the same s provides 4 virtual control points The virtual control points define a Bezier curve in t Evaluating this curve at t gives the point x(s,t) x(s,t) 4/27/04 © University of Wisconsin, CS559 Spring 2004

Properties of Bezier Patches Which vertices, if any, does the patch interpolate? Why? What can you say about the tangent plane at each corner? Why? Does the patch lie within the convex hull of its control vertices? 4/27/04 © University of Wisconsin, CS559 Spring 2004

Properties of Bezier Patches The patch interpolates its corner points Comes from the interpolation property of the underlying curves The tangent plane at each corner interpolates the corner vertex and the two neighboring edge vertices The tangent plane is the plane that is perpendicular to the normal vector at a point The tangent plane property derives from the curve tangent properties and the way to compute normal vectors The patch lies within the convex hull of its control vertices The basis functions sum to one and are positive everywhere 4/27/04 © University of Wisconsin, CS559 Spring 2004

Bezier Patch Matrix Form Note that the 3 matrices stay the same if the control points do not change The middle product can be pre-computed, leaving only: 4/27/04 © University of Wisconsin, CS559 Spring 2004

© University of Wisconsin, CS559 Spring 2004 Bezier Patch Meshes A patch mesh is just many patches joined together along their edges Patches meet along complete edges Each patch must be a quadrilateral OK Not OK Not OK OK 4/27/04 © University of Wisconsin, CS559 Spring 2004

Bezier Mesh Continuity Just like curves, the control points must satisfy constraints to ensure parametric continuity How do we ensure C0 continuity along an edge? How do we ensure C1 continuity along an edge? How do we ensure C2 continuity along an edge? For geometric continuity, constraints are less rigid What can you say about the vertices around a corner if there must be C1 continuity at the corner point? 4/27/04 © University of Wisconsin, CS559 Spring 2004

Bezier Mesh Continuity Just like curves, the control points must satisfy rigid constraints to ensure parametric continuity C0 continuity along an edge? Share control points at the edge C1 continuity along an edge? Control points across edge are collinear and equally spaced C2 continuity along an edge? Constraints extent to points farther from the edge For geometric continuity, constraints are less rigid Still collinear for G1, but can be anywhere along the line What can you say about the vertices around a corner if there must be C1 continuity at the corner point? They are co-planar (not the interior points, just corner and edge) 4/27/04 © University of Wisconsin, CS559 Spring 2004

Rendering Bezier Patches Option 1: Evaluate at fixed set of parameter values and join up with triangles Can’t use quadrilaterals because points may not be co-planar Ideal situation for triangle strips Advantage: Simple, and OpenGL has commands to do it for you Disadvantage: No easy way to control quality of appearance Option 2: Subdivision Allows control of error in the triangle approximation Extend 1D curve subdivision to do surfaces Similar to other subdivision schemes we’ve seen 4/27/04 © University of Wisconsin, CS559 Spring 2004

© University of Wisconsin, CS559 Spring 2004 Midpoint Subdivision Repeatedly join midpoints to find new control vertices Do it first for each row of original control points: 4x4 -> 4x7 Then do it for each column of new control points:4x7 -> 7x7 4/27/04 © University of Wisconsin, CS559 Spring 2004

© University of Wisconsin, CS559 Spring 2004 A Potential Problem One (good) way to subdivide, is: If a control mesh is flat enough – draw it Else, subdivide into 4 sub-patches and recurse on each Problem: Neighboring patches may not be subdivided to the same level Cracks can appear because join edges have different control meshes This can be fixed by adding extra edges Crack 4/27/04 © University of Wisconsin, CS559 Spring 2004

Computing Normal Vectors The partial derivative in the s direction is one tangent vector The partial derivative in the t direction is another Take their cross product, and normalize, to get the surface normal vector 4/27/04 © University of Wisconsin, CS559 Spring 2004

Bezier Curve/Surface Problems To make a long continuous curve with Bezier segments requires using many segments Same for large surface Maintaining continuity requires constraints on the control point positions The user cannot arbitrarily move control vertices and automatically maintain continuity The constraints must be explicitly maintained It is not intuitive to have control points that are not free 4/27/04 © University of Wisconsin, CS559 Spring 2004