UNIT-5 Curves and Surfaces.

Slides:



Advertisements
Similar presentations
Lecture 10 Curves and Surfaces I
Advertisements

Cubic Curves CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
CS 445/645 Fall 2001 Hermite and Bézier Splines. Specifying Curves Control Points –A set of points that influence the curve’s shape Knots –Control points.
© University of Wisconsin, CS559 Spring 2004
Dr. S.M. Malaek Assistant: M. Younesi
1 Curves and Surfaces. 2 Representation of Curves & Surfaces Polygon Meshes Parametric Cubic Curves Parametric Bi-Cubic Surfaces Quadric Surfaces Specialized.
Slide 127 October 1999CS Computer Graphics (Top Changwatchai) Review of Spline Concepts Sections 10-6 to in Hearn & Baker Splines can be 2D.
1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution.
Designing Parametric Cubic Curves Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
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.
Chapter 10: Curves and Surfaces Part 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
Designing Parametric Cubic Curves
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
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
V. Space Curves Types of curves Explicit Implicit Parametric.
Introduction to Computer Graphics with WebGL
Quadratic Surfaces. SPLINE REPRESENTATIONS a spline is a flexible strip used to produce a smooth curve through a designated set of points. We.
Curves and Surfaces Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico 1 Angel: Interactive.
June D Object Representation Shmuel Wimer Bar Ilan Univ., School of Engineering.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Curves and Surfaces Chapter 10. CS 480/680 2Chapter 9 -- Hierarchical Models Introduction: Introduction: Until now we have worked with flat entities such.
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.
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.
Rendering Curves and Surfaces Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico 1 Angel:
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.
(c) 2002 University of Wisconsin
Designing Parametric Cubic Curves 1. 2 Objectives Introduce types of curves ­Interpolating ­Hermite ­Bezier ­B-spline Analyze their performance.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Graphics CSCI 343, Fall 2015 Lecture 34 Curves and Surfaces III.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
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
Introduction to Parametric Curve and Surface Modeling
Computer Graphics Lecture 38
Surfaces and Curves.
CS5500 Computer Graphics May 11, 2006
Curve & Surface.
CS 445 / 645 Introduction to Computer Graphics
(Spline, Bezier, B-Spline)
Chapter 10-2: Curves.
University of New Mexico
University of New Mexico
University of New Mexico
Parametric Curves.
© University of Wisconsin, CS559 Fall 2004
Rendering Curves and Surfaces
Designing Parametric Cubic Curves
© University of Wisconsin, CS559 Spring 2004
Curves and Surfaces Ed Angel
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.
Parametric Line equations
Introduction to Computer Graphics with WebGL
Three-Dimensional Object Representation
Introduction to Parametric Curve and Surface Modeling
Curves and Surfaces (I)
Designing Parametric Cubic Curves
Presentation transcript:

UNIT-5 Curves and Surfaces

Curves Curves are one dimensional entities where the function is nonlinear Curves

Curves Modeling computer graphics element with curves requires specialized handles that manage the look of a curve in an intuitive way In addition, seaming curves to build models is also important, for example changing complexity in the middle of a curve (Maya makes it trivial)

Representations for curves Parametric representation x = x(u), y = y(u) or simply p(u) where p = More robust and general than other forms Gives better control over curves and surfaces Notation: p(u) = c0 + c1u + c2u2 where each c is a vector, ci = x y cix ciy

Representations for curves Example, quadric parametric curve: p(u) = c0 + c1u + c2u2 Like curve: x = 3u2 y = 2u + 3 for u = [-1,1] c0 = c1 = c2= 3 2 3 Note, more coefficients than a quadratic

Representations for curves Parametric curve, p(u) can as easily represent a curve in 3D (x,y,z) Simply: x = fx(u) y = fy(u) z = fz(u) Quadric coefs become: c0 = c1 = c2= cox coy coz c1x c1y c1z c2x c2y c2z

Parametric Cubic (pc) curves Extension of quadrics to cubics Represented as: Also called Hermite curves after the 17th century mathematician p(u) = c0 + c1u + c2u2 + c3u3

Parametric Cubic (pc) curves Algebraic form: (Note,unless otherwise specified u goes from 0,1) Not very intuitive, 12 values of c Instead want a better specify the curve More intuitive: control by start point p(0) and ending point p(1) and their derivatives p(u) = c0 + c1u + c2u2 + c3u3

Parametric Cubic (pc) curves From: Build a geometric form in order to specify a curves by their end points and tangents p(u) = c0 + c1u + c2u2 + c3u3 p(1) p’(1) p’(0) p(0)

Parametric Cubic curves This leads to the Geometric Form: where: F1(u) = 2u3 – 3u2 +1 F2(u) = -2u3 + 3u2 F3(u) = u3 – 2u2 + u F4(u) = u3 – u2 p(u) = F1(u)p(0) + F2(u)p(1) + F3(u)p’(0) + F4(u)p’(1)

Hermite curves basis F curves:

Joining Multiple Segments use p = [p3 p4 p5 p6]T use p = [p0 p1 p2 p3]T Get continuity at join points but not continuity of derivatives C0, C1, C2 continuity

Bezier Curves Family of curves developed in the 1970's by Bezier, a engineer for Renault, car manufacturer Bezier's curves are only guaranteed to pass through the end points, but other control points controlled the derivative at the end points Specifically, the tangent was controlled by the next control point in, the 2nd derivative by the second control point in, and the nth derivative by the nth and so on...

Bezier Curves

Bezier Curves p(u) = S pi fi(u) 0 < u < 1 The general form of the Bezier curve is: Vertices p control the curve and blending functions, fi(u), that satisfy the "derivative" condition Bernstein polynomials were a family of functions that were chosen by Bezier to satisfy his needs, these are not the only functions that could be used though n p(u) = S pi fi(u) 0 < u < 1 i=0

Convex Hull Property The properties of the Bernstein polynomials ensure that all Bezier curves lie in the convex hull of their control points Hence, even though we do not reach all the input data, we cannot be too far away p1 p2 convex hull Bezier curve p3 p0

Bernstein Polynomials The blending functions are a special case of the Bernstein polynomials These polynomials give the blending polynomials for any degree Bezier form All zeros at 0 and 1 For any degree they all sum to 1 They are all between 0 and 1 inside (0,1)

Bezier Matrix p(u) = uTMBp = b(u)Tp For a curve where n = 3, p is defined as: p(u) = (1-u)2p0 + 2u(1-u)p1 + u2p2 p(u) = uTMBp = b(u)Tp blending functions

Bezier Curves p(u) = (1-u)2p0 + 2u(1-u)p1 + u2p2 p2 p1 p0

n = 3 n = 5 n = 4 n = 6

Bezier Curves Bezier curves have intuitive control, are nicely formed, convex hull of all points

B Splines One problem with the curves we have looked at is that changing a single control point affects the whole curve (this is called global propogation,) Also, depends on # of control pts B-Splines offer an alternative, to only affect the local region if a single control point is modified (i.e. local propogation)

B Splines B-splines are also called Basis Splines They have a form similar to Bezier, B-splines are defined as: where n +1 is the number of control points and k controls the degree of the blending (or basis) functions n p(u) = S pi fi,k(u) 0 < u < n + 2 - k i=0

B Splines (u - ti) fi,m-1(u) (u - ti + m) fi+1,m-1(u) ti+m-1 - ti B-splines' blending functions are defined recursively: fi,1(u) = 1 if ti < u < ti+1 = 0 otherwise and fi,m(u) = m goes from 2 to k ti's are knot points relating u to control points, pi (u - ti) fi,m-1(u) (u - ti + m) fi+1,m-1(u) _ ti+m-1 - ti ti+m - ti+1

B Splines Knot points,ti's, follow along like this: ti = 0 if i < k ti = i - k + 1 if k < i < n ti = n- k + 2 if i > n

B Splines For 6 control pts & k = 1, We get the degenerate case: n= 5 and 0 < u < 6 We get the degenerate case: p(u) = p0 0 < u < 1 p(u) = p1 1 < u < 2 p(u) = p2 2 < u < 3 p(u) = p3 3 < u < 4 p(u) = p4 4 < u < 5 p(u) = p5 5 < u < 6

B Splines

B Splines For 6 control pts & k = 2, n= 5 and 0 < u < 5 We get a linear average of neighbors: p(u) = (1 - u)p0 + u p1 0 < u < 1 p(u) = (2 - u)p1 + (u - 1)p2 1 < u < 2 p(u) = (3 - u)p2 + (u - 2)p3 2 < u < 3 p(u) = (4 - u)p3 + (u - 3)p4 3 < u < 4 p(u) = (5 - u)p4 + (u - 4)p5 4 < u < 5

B Splines

B Splines For 6 control pts & k = 3, We get: n= 5 and 0 < u < 4 for 0 < u < 1 p1(u) = (1 - u)2p0 + .5u(4 - 3u) p1 + .5 u2p2 for 1 < u < 2 p2(u) = .5(2 - u)2p1 + .5(-2u2 + 6u - 3) p2 + .5(u - 1)2p3 for 2 < u < 3 p3(u) = .5(3 - u)2p2 + .5(-2u2 + 10u - 11) p3 + .5(u - 2)2p4 for 3 < u < 4 p4(u) = .5(4 - u)2p3 + .5(-3u2 + 20u - 32) p4 + (u - 3)2p5

B Splines Note, influence grows with degree k = 2 k = 3 k = 4

B Splines Thus, local influence of control points on curve as:

Cubic B-spline p(u) = uTMSp = b(u)Tp

Curves vs. Surfaces Curves are one dimensional entities where the function is nonlinear Surfaces are formed from two-dimensional functions Linear functions give planes and polygons y Curves x z Surfaces

Curves vs. Surfaces Parametric curve, p(u) can as easily represent a curve in 3D (x,y,z) x = fx(u) y = fy(u) z = fz(u) u = 1 u = -1

Curves vs. Surfaces Parametric surface is very similar: p(u,v) Simply: x = f(u, v) y = f(u, v) z = f(u, v) (Just, more difficult to comprehend in a 2D representation, we must go behind the image plane)

Parametric Surfaces Surfaces require 2 parameters x=x(u,v) y=y(u,v) z=z(u,v) p(u,v) = [x(u,v), y(u,v), z(u,v)]T Want same properties as curves: Smoothness Differentiability Ease of evaluation y p(u,1) p(0,v) p(1,v) x z p(u,0)

Bezier Patches Using same data array P=[pij] as with interpolating form Patch lies in convex hull

B-Spline Patches defined region

Rendering Curves How do we draw the curve, given p(u)? void evaluateCurve(u,pixelX,pixelY) p(1) tangent p’(1) p’(0) tangent p(0)

Rendering Curves Polyline approximation p(1) piecewise linear discrete approximation p(0)

Splitting a Cubic Bezier p0, p1 , p2 , p3 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 {l0, l1, l2, l3} and {r0, r1, r2, r3} that determine them

Efficient Form l0 = p0 r3 = p3 l1 = ½(p0 + p1) r1 = ½(p2 + p3) l2 = ½(l1 + ½( p1 + p2)) r1 = ½(r2 + ½( p1 + p2)) l3 = r0 = ½(l2 + r1) Requires only shifts and adds!

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

Second Subdivision 16 final points for 1 of 4 patches created

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

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