cs130 : computer graphics€¦ · cs130 : computer graphics curves (cont.) tamar shinar computer...
TRANSCRIPT
![Page 1: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/1.jpg)
CS130 : Computer Graphics Curves (cont.)
Tamar ShinarComputer Science & Engineering
UC Riverside
![Page 2: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/2.jpg)
Blending Functions
![Page 3: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/3.jpg)
Blending functions are more convenient basis than monomial basis
• “geometric form” (blending functions)
• “canonical form” (monomial basis)
- geometric form (bottom) is more intuitive because it combines control points with blending functions[ see Shirley Section 15.3]
![Page 4: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/4.jpg)
Interpolating Polynomials
![Page 5: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/5.jpg)
Interpolating polynomials
• Given n+1 data points, can find a unique interpolating polynomial of degree n
• Different methods:
• Vandermonde matrix
• Lagrange interpolation
• Newton interpolation
![Page 6: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/6.jpg)
higher order interpolating polynomials are rarely used
overshoots
non-local effects4th order (gray) to 5th order (black)
These images demonstrate problems with using higher order polynomials:- overshoots- non-local effects (in going from the 4th order polynomial in grey to the 5th order polynomial in black)
![Page 7: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/7.jpg)
Piecewise Polynomial Curves
![Page 8: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/8.jpg)
Example: blending functions for two line segments
b1(u) = 1-2u, 0 <= u <= .5 0 .5 <= u <= 1b2(u) = 2u, 0 <= u <= .5 2(1-u), .5 <= u <= 1b3(u) = 0 , 0 <= u <= .5 2u-1, .5 <= u <= 1
![Page 9: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/9.jpg)
Cubics
• Allow up to C2 continuity at knots
• need 4 control points
• may be 4 points on the curve, combination of points and derivatives, ...
• good smoothness and computational properties
need 4 control points: might be 4 points on the curve, combination of points and derivatives, ...
![Page 10: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/10.jpg)
We can get any 3 of 4 properties
1.piecewise cubic
2.curve interpolates control points
3.curve has local control
4.curves has C2 continuity at knots
![Page 11: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/11.jpg)
Cubics
• Natural cubics
• C2 continuity
• n points -> n-1 cubic segments
• control is non-local :(
• ill-conditioned x(
![Page 12: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/12.jpg)
Cubic Hermite Curves
• C1 continuity
• specify both positions and derivatives
![Page 13: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/13.jpg)
Cubic Hermite Curves
/
/
Specify endpointsand derivatives
construct curve with
C^1 continuity
![Page 14: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/14.jpg)
Hermite blending functions
[Wikimedia Commons]
![Page 15: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/15.jpg)
Example: keynote curve tool
![Page 16: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/16.jpg)
Interpolating vs. Approximating Curves
Interpolating Approximating(non-interpolating)
approximating
![Page 17: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/17.jpg)
Cubic Bezier Curves
![Page 18: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/18.jpg)
Cubic Bezier Curves
-The curve interpolates its first (u=0) and last (u = 1) control points- first derivative at the beginning is the vector from first to second point, scaled by degree
![Page 19: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/19.jpg)
Cubic Bezier Curve Examples
![Page 20: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/20.jpg)
Cubic Bezier blending functions
![Page 21: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/21.jpg)
Bezier Curves Degrees 2-6
![Page 22: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/22.jpg)
22
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 roots at 0 and 1 For any degree they all sum to 1 They are all between 0 and 1 inside (0,1)
![Page 23: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/23.jpg)
23
n = 3
n = 4
n = 5
n = 6
![Page 24: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/24.jpg)
Bezier Curve Properties
• curve lies in the convex hull of the data
• variation diminishing
• symmetry
• affine invariant
• efficient evaluation and subdivision
Shirley Section 15.6.1 (p. 368)
![Page 25: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/25.jpg)
Bezier Curve Properties
• curve lies in the convex hull of the data
• variation diminishing
• symmetry
• affine invariant
• efficient evaluation and subdivision
Shirley Section 15.6.1 (p. 368)
![Page 26: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/26.jpg)
Bezier Curve Properties
• curve lies in the convex hull of the data
• variation diminishing
• symmetry
• affine invariant
• efficient evaluation and subdivision
Shirley Section 15.6.1 (p. 368)
![Page 27: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/27.jpg)
Bezier Curve Properties
• curve lies in the convex hull of the data
• variation diminishing
• symmetry
• affine invariant
• efficient evaluation and subdivision
Shirley Section 15.6.1 (p. 368)
![Page 28: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/28.jpg)
Bezier Curve Properties
• curve lies in the convex hull of the data
• variation diminishing
• symmetry
• affine invariant
• efficient evaluation and subdivision
Shirley Section 15.6.1 (p. 368)
![Page 29: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/29.jpg)
Bezier Curve Properties
• curve lies in the convex hull of the data
• variation diminishing
• symmetry
• affine invariant
• efficient evaluation and subdivision
Shirley Section 15.6.1 (p. 368)
![Page 30: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/30.jpg)
Bezier Curve Properties
• curve lies in the convex hull of the data
• variation diminishing
• symmetry
• affine invariant
• efficient evaluation and subdivision
Shirley Section 15.6.1 (p. 368)
![Page 31: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/31.jpg)
Joining Cubic Bezier Curves
for C1 continuity, the vectors must line up and be the same lengthfor G1 continuity, the vectors need only line up
![Page 32: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/32.jpg)
Joining Cubic Bezier Curves• for C1 continuity, the vectors must line up and be the same length• for G1 continuity, the vectors need only line up
for C1 continuity, the vectors must line up and be the same lengthfor G1 continuity, the vectors need only line up
![Page 33: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/33.jpg)
Evaluating p(u) geometrically
![Page 34: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/34.jpg)
Evaluating p(u) geometrically
![Page 35: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/35.jpg)
Evaluating p(u) geometrically
![Page 36: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/36.jpg)
Evaluating p(u) geometrically
![Page 37: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/37.jpg)
Evaluating p(u) geometrically
![Page 38: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/38.jpg)
Evaluating p(u) geometrically
![Page 39: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/39.jpg)
Evaluating p(u) geometrically
De Casteljau algorithm
Kas-tell-joh
![Page 40: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/40.jpg)
Bezier subdivision
de Casteljau algorithmLeft: Subdivide the curve at the point u=.5 Right: Subdivide the curve at some other point u
![Page 41: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/41.jpg)
Recursive Subdivision for Rendering
![Page 42: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/42.jpg)
Cubic B-Splines
![Page 43: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/43.jpg)
Cubic B-Splines
![Page 44: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/44.jpg)
Spline blending functions
![Page 45: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/45.jpg)
General Splines
• Defined recursively by Cox-de Boor recursion formula
![Page 46: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/46.jpg)
Spline properties
convexity
Basis functions
![Page 47: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/47.jpg)
Surfaces
![Page 48: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/48.jpg)
Parametric Surface
![Page 49: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/49.jpg)
Parametric Surface - tangent plane
![Page 50: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/50.jpg)
Bicubic Surface Patch
![Page 51: CS130 : Computer Graphics€¦ · CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside. Blending Functions. Blending functions are more](https://reader036.vdocuments.site/reader036/viewer/2022062223/5f72fa5e931f274089179399/html5/thumbnails/51.jpg)
Bezier Surface Patch
Patch lies in convex hull