Computer Graphics: Difference between revisions

From Adam Colton
Jump to navigation Jump to search
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 18: Line 18:


Catmull-Clark Surface
Catmull-Clark Surface
=== Curves and Surfaces for CAGD ===
==== 1 (1) ====
In the French Auto industry both Paul de Castlejau and Pierre Bezier both created equivalent systems to describe the curves on automobiles. At Renault, Bezier developed UNISURF, an early CAD/CAM model.
This chapter provides a bunch of weird analogies for Curves.
==== Points and Vectors (13) ====
A point defines a location. Vectors are the result of subtracting points. Vectors can be added, points cannot.
Barycentric (or affine) Combinations allow points to be summed if the scalar coefficients of the expression sum to 1. I like this, it works, even with out addition because
  b = b<sub>0</sub> + &sum; a<sub>i</sub>(b<sub>i</sub> - b<sub>0</sub>)
which is still the sum of a point and a vector.
If all coefficients are positive, then the center of gravity lies inside the convex hull of the points.
Section on affine maps.
Norm Ellipse... not following this. I'm not clear on what the superscript T is.
Basis function is a function that "chooses", generally for a piecewise function. So
  t<sub>i</sub> is in a set of t, the points where the piecewise functions connect
  H<sub>i</sub>(t<sub>i</sub>) = 1
  H<sub>i</sub>(t<sub>j</sub>) = 0
  if t<sub>j</sub> != t<sub>i</sub>
==== Linear Interpolation (25) ====
A line from a to b can be defined as
  x = (1-t)a + t*b
A blossom is a curve formed from linesegments, we say b(t0, t1, ..., tn) where n is the same as the number of segments, we form a piecewise function of one degree lower by taking t0 of each line. This reduce down to a single point. The curve traced by passing in the same value for all arguments is a Bezier curve.
Meneloas theorm: Given piecewise Meneloas theorm says that the order of the arguments doesn't matter.
Page 33 covers the Liebniz formula - I may need to review this further. It's a special case of a blossom.
Discussion of tessalation, Dirichlet (Voronoi) and Delaunay.
==== The De Castlejau Algorithm (43) ====
Given 3 points b0, b1, b2
  B1,0(t) = (1-t)b0 + t*b1
  B1,1(t) = (1-t)b1 + t*b2
  B2,0(t) = (1-t)B1,0(t) + t*B1,1(t)
This traces a Bezier parabola.
The polygon formed by the points is the Bezier polygon or Control polygon. The curve over [0, 1] lies within this polygon.
To combine De Castlejau and Bezier in the terms of a Blossom, we define Bezier as B[t<sup>n</sup>] (where t<sup>n</sup> means "repeated as an argument n times" not exponentiation). In De Castlejau, for degree 3, this becomes
  b0 = B0,0 = B(0,0,0)
  b1 = B0,1 = B(0,0,1) B1,0 = B(0,0,t)
  b2 = B0,2 = B(0,1,1) B1,1 = B(0,t,1) B2,0 = B(0,t,t)
  b3 = B0,3 = B(1,1,1) B1,2 = B(t,1,1) B2,1 = B(t,t,1) B3,0 = B(t,t,t)
So the expression becomes
  B<sub>i,j</sub> = B(0<sup>n-i-j</sup>, t<sup>i</sup>, 1<sup>j</sup>) = (1-t)B(0<sup>n-i-j+1</sup>, t<sup>i-1</sup>, 1<sup>j</sup>) + t*B(0<sup>n-i-j</sup>, t<sup>i-1</sup>, 1<sup>j+1</sup>)
And if i==0, we are a definition point and if i==n, we're at a Bezier point.
We can get a subdivision of the curve between k and l by creating a new blossom from the points in
  B(a<sup>n-i</sup>, b<sup>i</sup>) for i in 0,n
==== The Bernstein Form (57) ====
This is the form I am most familiar with:
  B(t) = &sum; Bino(n,i)*t<sup>i</sup>*(1-t)<sup>n-i</sup>*b<sub>i</sub>
Bezier curves are invariant under affine maps but not perspective maps. So an affine map can be applied to the control polygon and the curve computed and it will be correct.
Nice trick, for two curves of the same degree the affine combination for each point produces the affine combination of the two curves.
Derivative of Bezier curve. Difference of control points. The De Castlejau also produces the derivative as a byproduct.
De Castlejau can be used to create a subdivision. Given b0,b1,b2,b3 the control polygon for the first half of the curve will be
  c0 = B[0,0,0]
  c1 = B[0.5,0,0]
  c2 = B[0.5,0.5,0]
  c3 = B[0.5,0.5,0.5]
Line intersections can be found with repeated subdivision. If a line does not intersect the control polygon, it does not intersect the curve. If it does intersect the polygon, subdivide and recheck.


== B-spline ==
== B-spline ==
Line 117: Line 38:
   N<sub>i,j</sub>(t) = (t - t<sub>i</sub>)/(t<sub>i+j</sub> - t<sub>i</sub>)N<sub>i,j-1</sub>(t) + (t<sub>i+j+1</sub> - t)/(t<sub>i+j+1</sub> - t<sub>i+1</sub>)N<sub>i+1,j-1</sub>(t)
   N<sub>i,j</sub>(t) = (t - t<sub>i</sub>)/(t<sub>i+j</sub> - t<sub>i</sub>)N<sub>i,j-1</sub>(t) + (t<sub>i+j+1</sub> - t)/(t<sub>i+j+1</sub> - t<sub>i+1</sub>)N<sub>i+1,j-1</sub>(t)
This forms a triangle because each N where j!= is dependent on two N where j is one less. And the curve itself is the case where i=0 j=n. The ternary acts like a switch that turns on one N where j=0.
This forms a triangle because each N where j!= is dependent on two N where j is one less. And the curve itself is the case where i=0 j=n. The ternary acts like a switch that turns on one N where j=0.
[[Category:Computer Graphics]]

Latest revision as of 14:02, 28 August 2019

I'm leaving this as is, but really my interest is "Computational Geometry"

Notes

BCS

  • Flat shading
  • Gouraud Shading
  • Phong Shading

Catmull-Clark Surface

B-spline

Basis Spline; a curve defined by control points and a knot vector.

  • Joins many low degree Bezier curves

A k degree B-spline deined by n control points will have n-k Bezier curves. So a cubic (k=3) B-spline with 6 control points will have n-k = 6-3 = 3 Bezier curves.

  • C0 continuity means that the last point on each Bezier curve is the same as the first point on the next - there are no gaps.
  • C1 the derivatives of the curves are continuous
  • C2 the second derivatives of the curves are continuous

The length of the knot vector is m=k+n. For a uniform knot vector (most common), the numbers will be integers increasing by one, so m=5 will be T=(0,1,2,3,4).

 S(t) = ∑inNi,k(t)Pi
 Ni,0(t) = (ti <= t < ti+1</sub) ? 1 : 0
 Ni,j(t) = (t - ti)/(ti+j - ti)Ni,j-1(t) + (ti+j+1 - t)/(ti+j+1 - ti+1)Ni+1,j-1(t)

This forms a triangle because each N where j!= is dependent on two N where j is one less. And the curve itself is the case where i=0 j=n. The ternary acts like a switch that turns on one N where j=0.