B-Spline Blending Functions

Slides:



Advertisements
Similar presentations
Splines IV – B-spline Curves
Advertisements

Curves Jim Van Verth Essential Math for Games Animation Problem: want to replay stored set of transformations  Generated by.
Lecture Notes #11 Curves and Surfaces II
Lecture 10 Curves and Surfaces I
Geometric Modeling Notes on Curve and Surface Continuity Parts of Mortenson, Farin, Angel, Hill and others.
© University of Wisconsin, CS559 Spring 2004
Jehee Lee Seoul National University
1 Curves and Surfaces. 2 Representation of Curves & Surfaces Polygon Meshes Parametric Cubic Curves Parametric Bi-Cubic Surfaces Quadric Surfaces Specialized.
Informationsteknologi Monday, December 10, 2007Computer Graphics - Class 161 Today’s class Curve fitting Evaluators Surfaces.
CS CS 175 – Week 9 B-Splines Definition, Algorithms.
Week 4 : Curves Topics: parametric curves, Bezier curves, Hermite curves, b-splines/NURBS curves, NURBS surfaces.
Rational Bezier Curves
Offset of curves. Alina Shaikhet (CS, Technion)
1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution.
Geometric Modeling Surfaces Mortenson Chapter 6 and Angel Chapter 9.
Cubic Bezier and B-Spline Curves
Curves Mortenson Chapter 2-5 and Angel Chapter 9
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.
1 Representing Curves and Surfaces. 2 Introduction We need smooth curves and surfaces in many applications: –model real world objects –computer-aided.
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.
(Spline, Bezier, B-Spline)
V. Space Curves Types of curves Explicit Implicit Parametric.
Introduction to Computer Graphics with WebGL
CS 445 / 645 Introduction to Computer Graphics Lecture 23 Bézier Curves Lecture 23 Bézier Curves.
Cornell CS465 Fall 2004 Lecture 15© 2004 Steve Marschner 1 2D Spline Curves CS 465 Lecture 15.
Quadratic Surfaces. SPLINE REPRESENTATIONS a spline is a flexible strip used to produce a smooth curve through a designated set of points. We.
INTERPOLATION & APPROXIMATION. Curve algorithm General curve shape may be generated using method of –Interpolation (also known as curve fitting) Curve.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Parametric Curves.
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.
Splines IV – B-spline Curves based on: Michael Gleicher: Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
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.
Computer Graphics Representing Curves and Surfaces.
Geometric Modelling 2 INFO410 & INFO350 S Jack Pinches
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
CS 445 / 645 Introduction to Computer Graphics Lecture 23 Bézier Curves Lecture 23 Bézier Curves.
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.
Interpolating Splines, Implicit Descriptions Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Friday, March 5,
11/26/02(C) University of Wisconsin Last Time BSplines.
Parametric Curves CS 318 Interactive Computer Graphics John C. Hart.
(c) 2002 University of Wisconsin
Slide 129 October 1999CS Computer Graphics (Top Changwatchai) Bézier Curves - Results of Derivation Tangents at endpoints are equal to endpoint slopes.
1 CS 430/536 Computer Graphics I B-Splines and NURBS Week 5, Lecture 9 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent Computing.
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.
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.
Introduction to Parametric Curve and Surface Modeling.
© University of Wisconsin, CS559 Spring 2004
Introduction to Parametric Curve and Surface Modeling
CS5500 Computer Graphics May 11, 2006
Curve & Surface.
Representation of Curves & Surfaces
2D Spline Curves CS 465 Lecture 15 © 2004 Steve Marschner • 1.
© University of Wisconsin, CS559 Fall 2004
© University of Wisconsin, CS559 Fall 2004
© University of Wisconsin, CS559 Spring 2004
Spline Curves COMP 575/COMP 770.
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
Presentation transcript:

B-Spline Blending Functions The recurrence relation starts with the 1st order B-splines, just boxes, and builds up successively higher orders This algorithm is the Cox - de Boor algorithm Carl de Boor is in the CS department here at Madison

Uniform Cubic B-splines Uniform cubic B-splines arise when the knot vector is of the form (-3,-2,-1,0,1,…,n+1) Each blending function is non-zero over a parameter interval of length 4 All of the blending functions are translations of each other Each is shifted one unit across from the previous one Bk,d(t)=Bk+1,d(t+1) The blending functions are the result of convolving a box with itself d times, although we will not use this fact

Bk,1

Bk,2

Bk,3

B0,4

B0,4

Uniform Cubic B-spline Blending Funcs

Computing the Curve P1B1,4 P4B4,4 P0B0,4 P2B2,4 P6B6,4 P3B3,4 P5B5,4

Using Uniform B-splines At any point t along a piecewise uniform cubic B-spline, there are four non-zero blending functions Each of these blending functions is a translation of B0,4 Consider the interval 0t<1 We pick up the 4th section of B0,4 We pick up the 3rd section of B1,4 We pick up the 2nd section of B2,4 We pick up the 1st section of B3,4

Blending Function on [0,1]

Uniform B-spline on [0,1) Four control points are required to define the curve for 0t<1 The blending functions sum to one, and are positive everywhere The curve lies inside its convex hull Does the curve interpolate its endpoints? Look at the blending functions to decide There is also a matrix form for the curve:

Uniform B-spline at Arbitrary t The interval from an integer parameter value i to i+1 is essentially the same as the interval from 0 to 1 The parameter value is offset by i A different set of control points is needed To evaluate a uniform cubic B-spline at an arbitrary parameter value t: Find the greatest integer less than or equal to t: i = floor(t) Evaluate: Valid parameter range: 0t<n-3, where n is the number of control points

Loops To create a loop, use control points from the start of the curve when computing values at the end of the curve: Any parameter value is now valid Although for numerical reasons it is sensible to keep it within a small multiple of n

B-splines and Interpolation, Continuity Uniform B-splines do not interpolate control points, unless: You repeat a control point three times But then all derivatives also vanish (=0) at that point To do interpolation with non-zero derivatives you must use non-uniform B-splines with repeated knots To align tangents, use double control vertices Then tangent aligns similar to Bezier curve Uniform B-splines are automatically C2 All the blending functions are C2, so sum of blending functions is C2 Provides an alternate way to define blending functions To reduce continuity, must use non-uniform B-splines with repeated knots

Rendering B-splines Same basic options as for Bezier curves Evaluate at a set of parameter values and join with lines Hard to know where to evaluate, and how pts to use Use a subdivision rule to break the curve into small pieces, and then join control points What is the subdivision rule for B-splines? Instead of subdivision, view splitting as refinement: Inserting additional control points, and knots, between the existing points Useful not just for rendering - also a user interface tool Defined for uniform and non-uniform B-splines by the Oslo algorithm

Refining Uniform Cubic B-splines Basic idea: Generate 2n-3 new control points: Add a new control point in the middle of each curve segment: P’0,1, P’1,2, P’2,3 , …, P’n-2,n-1 Modify existing control points: P’1, P’2, …, P’n-2 Throw away the first and last control Rules: If the curve is a loop, generate 2n new control points by averaging across the loop When drawing, don’t draw the control polygon, join the X(i) points

Rational Curves Each point is the ratio of two curves Advantages: Just like homogeneous coordinates: NURBS: x(t), y(t), z(t) and w(t) are non-uniform B-splines Advantages: Perspective invariant, so can be evaluating in screen space Can perfectly represent conic sections: circles, ellipses, etc Piecewise cubic curves cannot do this

OpenGL and Parametric Curves OpenGL defines evaluators that evaluate a Bezier curve at a point You give it the control points: glMap1f(…) Access a specific point: glEvalCoord(param) Access a sequence: glMapGrid1f(n, t1,t2) glEvalMesh1f(mode, p1, p2) These functions evaluate the curve at equally spaced points - the poor way of drawing! In hardware? Not yet, it seems.

OpenGL and NURBS NURBS: Non-uniform Rational B-splines The curved surface of choice in CAD packages Support routines are part of the GLu utility library Allows you to specify how they are rendered: Can use points constantly spaced in parametric space Can use various error tolerances - the good way! Allows you to get back the lines that would be drawn Allows you to specify trim curves Only for surfaces (next lecture) Cut out parts of the surface - in parametric space

From B-spline to Bezier Both B-spline and Bezier curves represent cubic curves, so either can be used to go from one to the other Recall, a point on the curve can be represented by a matrix equation: P is the column vector of control points M depends on the representation: MB-spline and MBezier T is the column vector containing: t3, t2, t, 1 By equating points generated by each representation, we can find a matrix MB-spline->Bezier that converts B-spline control points into Bezier control points

B-spline to Bezier Matrix