College of Computer and Information Science, Northeastern UniversityApril 12, 20151 CS G140 Graduate Computer Graphics Prof. Harriet Fell Spring 2007 Lecture.

Slides:



Advertisements
Similar presentations
Splines I – Curves and Properties
Advertisements

Interpolating curves.
Lecture Notes #11 Curves and Surfaces II
Parametric Curves Ref: 1, 2.
College of Computer and Information Science, Northeastern UniversityApril 17, CS U540 Computer Graphics Prof. Harriet Fell Spring 2009 Lecture 9.
© University of Wisconsin, CS559 Spring 2004
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.
Lecture 10 Curves and Surfaces I
ICS 415 Computer Graphics Bézier Splines (Chapter 8)
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.
Jehee Lee Seoul National University
1 Introduction Curve Modelling Jack van Wijk TU Eindhoven.
1 Chapter 4 Interpolation and Approximation Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
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.
Splines II – Interpolating Curves
Informationsteknologi Monday, December 10, 2007Computer Graphics - Class 161 Today’s class Curve fitting Evaluators Surfaces.
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai.
1 Dr. Scott Schaefer The Bernstein Basis and Bezier Curves.
Geometric Modeling Surfaces Mortenson Chapter 6 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.
Computer Graphics Lecture 13 Curves and Surfaces I.
Curve Modeling Bézier Curves
Curves and Surfaces CSE3AGR - Paul Taylor Polynomials of Degree n Degree is equal to the highest exponent of a term. Higher exponents result in.
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
Spline Representations
Regression analysis Control of built engineering objects, comparing to the plan Surveying observations – position of points Linear regression Regression.
CS 445 / 645 Introduction to Computer Graphics Lecture 23 Bézier Curves Lecture 23 Bézier Curves.
Curves.
Quadratic Surfaces. SPLINE REPRESENTATIONS a spline is a flexible strip used to produce a smooth curve through a designated set of points. We.
CS 376 Introduction to Computer Graphics 04 / 20 / 2007 Instructor: Michael Eckmann.
June D Object Representation Shmuel Wimer Bar Ilan Univ., School of Engineering.
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.
CS559: Computer Graphics Lecture 19: Curves Li Zhang Spring 2008.
Keyframing and Splines Jehee Lee Seoul National University.
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
Basic Theory (for curve 02). 1.3 Parametric Curves  The main aim of computer graphics is to display an arbitrary surface so that it looks real.  The.
Representation of Curves & Surfaces Prof. Lizhuang Ma Shanghai Jiao Tong University.
CSCE 441 Computer Graphics: Keyframe Animation/Smooth Curves Jinxiang Chai.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Parametric Curves & Surfaces Greg Humphreys University of Virginia CS 445, Spring.
Splines I – Curves and Properties based on: Michael Gleicher Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
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.
CS 325 Computer Graphics 04 / 30 / 2010 Instructor: Michael Eckmann.
College of Computer and Information Science, Northeastern UniversityFebruary 27, CS U540 Computer Graphics Prof. Harriet Fell Spring 2009 Lectures.
CS559: Computer Graphics Lecture 13: Hierarchical Modeling and Curves Li Zhang Spring 2010.
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.
CSCI480/582 Lecture 9 Chap.2.2 Cubic Splines – Hermit and Bezier Feb, 11, 2009.
CS G140 Graduate Computer Graphics
COMPUTER GRAPHICS CHAPTERS CS 482 – Fall 2017 SPLINES
Representation of Curves & Surfaces
CS 445 / 645 Introduction to Computer Graphics
© University of Wisconsin, CS559 Fall 2004
© University of Wisconsin, CS559 Spring 2004
CS U540 Computer Graphics Prof. Harriet Fell Spring 2007
Chapter XVII Parametric Curves and Surfaces
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.
Three-Dimensional Object Representation
Introduction to Parametric Curve and Surface Modeling
Type to enter a caption. Computer Graphics Week 10 Lecture 1.
Presentation transcript:

College of Computer and Information Science, Northeastern UniversityApril 12, CS G140 Graduate Computer Graphics Prof. Harriet Fell Spring 2007 Lecture 6 – February 26, 2007

College of Computer and Information Science, Northeastern UniversityApril 12, Today’s Topics Bezier Curves and Splines Parametric Bicubic Surfaces Quadrics

College of Computer and Information Science, Northeastern UniversityApril 12, Curves A curve is the continuous image of an interval in n-space. Implicit f(x, y) = 0 x 2 + y 2 – R 2 = 0 Parametric (x(t), y(t)) = P(t) P(t) = tA + (1-t)B A B Generative proc  (x, y)

College of Computer and Information Science, Northeastern UniversityApril 12, Curve Fitting We want a curve that passes through control points. How do we create a good curve? What makes a good curve?

College of Computer and Information Science, Northeastern UniversityApril 12, Axis Independence If we rotate the set of control points, we should get the rotated curve.

Local Control

College of Computer and Information Science, Northeastern UniversityApril 12, Variation Diminishing Never crosses a straight line more than the polygon crosses it.

College of Computer and Information Science, Northeastern UniversityApril 12, Continuity C 0 continuity C 1 continuity C 2 continuity G 2 continuity Not C 2 continuity

College of Computer and Information Science, Northeastern UniversityApril 12, How do we Fit Curves? Lagrange Interpolating Polynomial from mathworld The Lagrange interpolating polynomial is the polynomial of degree n-1 that passes through the n points, (x 1, y 1 ), (x 2, y 2 ), …, (x n, y n ), and is given by

College of Computer and Information Science, Northeastern UniversityApril 12, Example 1

College of Computer and Information Science, Northeastern UniversityApril 12, Polynomial Fit P(x) = -.5x(x-2)(x-3)(x-4)

College of Computer and Information Science, Northeastern UniversityApril 12, Piecewise Fit P a (x) = x (x ) 0  x  1.5 P b (x) = 5.4 x (x ) 1.5  x  2 P c (x) = 0 2  x  4

College of Computer and Information Science, Northeastern UniversityApril 12, Spline Curves

College of Computer and Information Science, Northeastern UniversityApril 12, Splines and Spline Ducks Marine Drafting Weights

College of Computer and Information Science, Northeastern UniversityApril 12, Drawing Spline Today (esc)

College of Computer and Information Science, Northeastern UniversityApril 12, Hermite Cubics p q Dp Dq P(t) = at 3 + bt 2 +ct +d P(0) = p P(1) = q P'(0) = Dp P'(1) = Dq

College of Computer and Information Science, Northeastern UniversityApril 12, Hermite Coefficients P(t) = at 3 + bt 2 +ct +d P(0) = p P(1) = q P'(0) = Dp P'(1) = Dq For each coordinate, we have 4 linear equations in 4 unknowns

College of Computer and Information Science, Northeastern UniversityApril 12, Boundary Constraint Matrix

College of Computer and Information Science, Northeastern UniversityApril 12, Hermite Matrix MHMH GHGH

College of Computer and Information Science, Northeastern UniversityApril 12, Hermite Blending Functions

College of Computer and Information Science, Northeastern UniversityApril 12, Splines of Hermite Cubics a C 1 spline of Hermite curves a G 1 but not C 1 spline of Hermite curves The vectors shown are 1/3 the length of the tangent vectors.

College of Computer and Information Science, Northeastern UniversityApril 12, Computing the Tangent Vectors Catmull-Rom Spline p1 p1 p2 p2 p3 p3 p4 p4 p 5 P(0) = p 3 P(1) = p 4 P'(0) = ½ (p 4 - p 2 ) P'(1) = ½ (p 5 - p 3 )

College of Computer and Information Science, Northeastern UniversityApril 12, Cardinal Spline The Catmull-Rom spline P(0) = p 3 P(1) = p 4 P'(0) = ½ (p 4 - p 2 ) P'(1) = ½ (p 5 - p 3 ) is a special case of the Cardinal spline P(0) = p 3 P(1) = p 4 P'(0) = (1 - t)(p 4 - p 2 ) P'(1) = (1 - t)(p 5 - p 3 ) 0 ≤ t ≤ 1 is the tension.

College of Computer and Information Science, Northeastern UniversityApril 12, Drawing Hermite Cubics How many points should we draw? Will the points be evenly distributed if we use a constant increment on t ? We actually draw Bezier cubics.

College of Computer and Information Science, Northeastern UniversityApril 12, General Bezier Curves

College of Computer and Information Science, Northeastern UniversityApril 12, Low Order Bezier Curves p0p0 n = 0 b 0,0 (t) = 1 B(t) = p 0 b 0,0 (t) = p 0 0 ≤ t ≤ 1 p0p0 n = 1 b 0,1 (t) = 1 - t b 1,1 (t) = t B(t) = (1 - t) p 0 + t p 1 0 ≤ t ≤ 1 p1p1 p0p0 n = 2b 0,2 (t) = (1 - t) 2 b 1,2 (t) = 2t (1 - t) b 2,2 (t) = t 2 B(t) = (1 - t) 2 p 0 + 2t (1 - t)p 1 + t 2 p 2 0 ≤ t ≤ 1 p1p1 p2p2

College of Computer and Information Science, Northeastern UniversityApril 12, Bezier Curves Bezier Arch p q r s n = 3b 0,3 (t) = (1 - t) 3 b 1,3 (t) = 3t (1 - t) 2 b 2,3 (t) = 3t 2 (1 - t) b 2,3 (t) = t 3 B(t) = (1 - t) 3 p + 3t (1 - t) 2 q + 3t 2 (1 - t)r + t 3 s 0 ≤ t ≤ 1

College of Computer and Information Science, Northeastern UniversityApril 12, Bezier Matrix MBMB B(t) = (1 - t) 3 p + 3t (1 - t) 2 q + 3t 2 (1 - t)r + t 3 s 0 ≤ t ≤ 1 B(t) = a t 3 + bt 2 + ct + d 0 ≤ t ≤ 1 GBGB

College of Computer and Information Science, Northeastern UniversityApril 12, Geometry Vector

College of Computer and Information Science, Northeastern UniversityApril 12, Properties of Bezier Curves

College of Computer and Information Science, Northeastern UniversityApril 12, Geometry of Bezier Arches p q r s Pick a t between 0 and 1 and go t of the way along each edge. B(t)B(t) Join the endpoints and do it again.

College of Computer and Information Science, Northeastern UniversityApril 12, Geometry of Bezier Arches p q r s We only use t = 1/2. pqrs = B(1/2) pq qr rs pqr qrs

drawArch(P, Q, R, S){ if (ArchSize(P, Q, R, S) <=.5 ) Dot(P); else{ PQ = (P + Q)/2; QR = (Q + R)/2; RS = (R + S)/2; PQR = (PQ + QR)/2; QRS = (QR + RS)/2; PQRS = (PQR + QRS)/2 drawArch(P, PQ, PQR, PQRS); drawArch(PQRS, QRS, RS, S); }

College of Computer and Information Science, Northeastern UniversityApril 12, Putting it All Together Bezier Archer and Catmull-Rom Splines

College of Computer and Information Science, Northeastern UniversityApril 12, Time for a Break

College of Computer and Information Science, Northeastern UniversityApril 12, Surface Patch P(u,v) 0  u, v  1 A patch is the continuous image of a square in n-space.

College of Computer and Information Science, Northeastern UniversityApril 12, Bezier Patch Geometry

College of Computer and Information Science, Northeastern UniversityApril 12, Bezier Patch P 00 P 10 P 01 P 02 P 03 P 11 P 12 P 13 P 20 P 30 P 21 P 22 P 23 P 31 P 32 P 33

College of Computer and Information Science, Northeastern UniversityApril 12, Bezier Patch Computation

College of Computer and Information Science, Northeastern UniversityApril 12, Bezier Patch P 00 P 10 P 01 P 02 P 03 P 11 P 12 P 13 P 20 P 30 P 21 P 22 P 23 P 31 P 32 P 33 Q(0,v) Q(1,v) Q(u,0) Q(u,1)

College of Computer and Information Science, Northeastern UniversityApril 12, Bezier Patch P 00 P 10 P 01 P 02 P 03 P 11 P 12 P 13 P 20 P 30 P 21 P 22 P 23 P 31 P 32 P 33 Q u (0,0) = 3(P 10 – P 00 ) Q v (0,0) = 3(P 01 – P 00 ) Q uv (0,0) = 9(P 00 – P 01 – P 10 + P 11 )

College of Computer and Information Science, Northeastern UniversityApril 12, Properties of Bezier Surfaces A Bézier patch transforms in the same way as its control points under all affine transformations All u = constant and v = constant lines in the patch are Bézier curves. A Bézier patch lies completely within the convex hull of its control points. The corner points in the patch are the four corner control points. A Bézier surface does not in general pass through its other control points.

College of Computer and Information Science, Northeastern UniversityApril 12, Rendering Bezier Patches with a mesh Chris Bently - Rendering Bezier Patches 3. Use these derived points as the control points for new Bezier curves running in the v direction 1. Consider each row of control points as defining 4 separate Bezier curves: Q 0 (u) … Q 3 (u) 2. For some value of u, say 0.1, for each Bezier curve, calculate Q 0 (u) … Q 3 (u). 4. Generate edges and polygons from grid of surface points.

College of Computer and Information Science, Northeastern UniversityApril 12, Subdividing Bezier Patch P 00 P 10 P 01 P 02 P 03 P 11 P 12 P 13 P 20 P 30 P 21 P 22 P 23 P 31 P 32 P 33 Subdivide until the control points are coplanar.

College of Computer and Information Science, Northeastern UniversityApril 12, Blending Bezier Patches

Teapot Data double teapot_data[][] = { { , 0.00, 30.00, , , 30.00, , , 30.00, 0.00, , 30.00, , 0.00, 12.00, , , 12.00, , , 12.00, 0.00, , 12.00, , 0.00, 3.00, , , 3.00, , , 3.00, 0.00, , 3.00, , 0.00, 0.00, , , 0.00, , , 0.00, 0.00, , 0.00, }, …

College of Computer and Information Science, Northeastern UniversityApril 12, Bezier Patch Continuity If these sets of control points are colinear, the surface will have G 1 continuity.

College of Computer and Information Science, Northeastern UniversityApril 12, Quadric Surfaces ellipsoidelliptic cylinder

College of Computer and Information Science, Northeastern UniversityApril 12, Quadric Surfaces 1-sheet hyperboloid 2-sheet hyperboloid

College of Computer and Information Science, Northeastern UniversityApril 12, Quadric Surfaces cones

College of Computer and Information Science, Northeastern UniversityApril 12, elliptic parabaloid hyperbolic parabaloid

College of Computer and Information Science, Northeastern UniversityApril 12, Quadric Surfaces hyperbolic cylinder parabolic cylinder

College of Computer and Information Science, Northeastern UniversityApril 12, General Quadrics in General Position

College of Computer and Information Science, Northeastern UniversityApril 12, General Quadric Equation Ray Equations

College of Computer and Information Science, Northeastern UniversityApril 12, Ray Quadric Intersection Quadratic Coefficients A = a*xd*xd + b*yd*yd + c*zd*zd + 2[d*xd*yd + e*yd*zd + f*xd*zd B = 2*[a*x0*xd + b*y0*yd + c*z0*zd + d*(x0*yd + xd*y0 ) + e*(y0*zd + yd*z0 ) + f*(x0*zd + xd*z0 ) + g*xd + h*yd + j*zd] C = a*x0*x0 + b*y0*y0 + c*z0*z0 + 2*[d*x0*y0 + e*y0*z0 + f*x0*z0 + g*x0 + h*y0 + j*z0] + k

College of Computer and Information Science, Northeastern UniversityApril 12, Quadric Normals Normalize N and change its sign if necessary.

College of Computer and Information Science, Northeastern UniversityApril 12, MyCylinders

College of Computer and Information Science, Northeastern UniversityApril 12, Student Images

College of Computer and Information Science, Northeastern UniversityApril 12, Student Images