DOC PREVIEW
UCSD CSE 167 - Cubic Curves

This preview shows page 1-2-14-15-29-30 out of 30 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 30 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Cubic CurvesCSE167: Computer GraphicsInstructor: Steve RotenbergUCSD, Fall 2005Project 3Render a smooth, cubic surface by tessellating it into a set of trianglesDue November 17Polynomial FunctionsLinear:Quadratic:Cubic:( )( )( )dctbtattfcbtattfbattf+++=++=+=232Vector Polynomials (Curves)Linear:Quadratic:Cubic:We usually define the curve for 0 ≤ t ≤ 1( )( )( )dcbafcbafbaf+++=++=+=ttttttttt232Linear InterpolationLinear interpolation (Lerp) is a common technique for generating a new value that is somewhere in between two other valuesA ‘value’ could be a number, vector, color, or even something more complex like an entire 3D object…Consider interpolating between two points a and b by some parameter t( ) ( )baba tttL erp +−= 1,,abt=1..0<t<1t=0Bezier CurvesBezier curves can be thought of as a higher order extension of linear interpolationp0p1p0p1p2p0p1p2p3Linear Quadratic CubicBezier Curve FormulationThere are lots of ways to formulate Bezier curves mathematically. Some of these include:de Castlejau (recursive linear interpolations)Bernstein polynomials (functions that define the influence of each control point as a function of t)Cubic equations (general cubic equation of t)Matrix formWe will briefly examine each of theseBezier Curvep0p1p2p3Find the point x on the curve as a function of parameter t:x(t)•de Casteljau AlgorithmThe de Casteljau algorithm describes the curve as a recursive series of linear interpolationsThis form is useful for providing an intuitive understanding of the geometry involved, but it is not the most efficient formde Casteljau Algorithmp0p1p2p3We start with our original set of pointsIn the case of a cubic Bezier curve, we start with four pointsde Casteljau Algorithmp0q0p1p2p3q2q1( )( )( )322211100,,,,,,ppqppqppqtLer ptLerptLerp===de Casteljau Algorithmq0q2q1r1r0( )( )211100,,,,qqrqqrtLerptLerp==de Casteljau Algorithmr1xr0•( )10,, rrx tLerp=Bezier Curvex•p0p1p2p3Recursive Linear Interpolation( )( )( )322211100,,,,,,ppqppqppqtLerptLerptLer p===( )( )211100,,,,qqrqqrtLerptLerp==( )10,, rrx tLerp=3210pppp210qqq10rrx3210ppppExpanding the Lerps( ) ( )( ) ( )( ) ( )( ) ( ) ( )( ) ( )( )( ) ( ) ( )( ) ( )( )( ) ( ) ( ) ( )( ) ( )( )( )( ) ( )( ) ( )( )( )3221211010322121121101003232221211101001111111,,111,,111,,1,,1,,1,,pppppppprrxppppqqrppppqqrppppqppppqppppqtttttttttttttttLerptttttttLerptttttttLerptttLerptttLerptttLerp+−++−−++−++−−−==+−++−−==+−++−−==+−==+−==+−==Bernstein Polynomial Form( ) ( ) ( )( ) ( )( )( )( ) ( )( ) ( )( )( )( ) ( ) ( )( ) ( )( ) ( )33223123023332212033221211033363133131311111111ppppxppppxppppppppxttttttttttttttttttttttttttttt++−++−++−+−=+−+−+−=+−++−−++−++−−−=Cubic Bernstein Polynomials( ) ( )( ) ( )( ) ( ) ( ) ( )( )( )( )( )333233223312330333232131030332231230233336313333363133ttBtttBttttBttttBtBtBtBtBttttttttt=+−=+−=+−+−=+++=++−++−++−+−=ppppxppppxBernstein PolynomialsB33B03B13B23Bernstein Polynomials( )( )( )( )( )( )( )( )( )( ) ( ) ( )( )( )1!!!112212333631331110222221220333233223312330=−=−==+−==+−=+−==+−=+−=+−+−=∑−tBinininttintBttBttBttBtttBtttBttBtttBttttBttttBniiinniBernstein Polynomials( ) ( ) ( )( ) ( )∑=−=−=niiniiinnitBtttintB01pxBernstein polynomial form of a Bezier curve:Bernstein PolynomialsWe start with the de Casteljau algorithm, expand out the math, and group it into polynomial functions of t multiplied by points in the control meshThe generalization of this gives us the Bernstein form of the Bezier curveThis gives us further understanding of what is happening in the curve:We can see the influence of each point in the control mesh as a function of tWe see that the basis functions add up to 1, indicating that the Bezier curve is a convex average of the control pointsCubic Equation Form( ) ( )( ) ( )( ) ( )( ) ( )133363333336313301022103321033223123023ppppppppppxppppx++−++−++−+−=++−++−++−+−=ttttttttttttCubic Equation Form( ) ( )( ) ( )( )( )( )( )010210321023010221033210333633313336333pdppcpppbppppadcbaxppppppppppx=+−=+−=+−+−=+++=++−++−++−+−=ttttttCubic Equation FormIf we regroup the equation by terms of exponents of t, we get it in the standard cubic formThis form is very good for fast evaluation, as all of the constant terms (a,b,c,d) can be precomputedThe cubic equation form obscures the input geometry, but there is a one-to-one mapping between the two and so the geometry can always be extracted out of the cubic coefficientsCubic Matrix Form( )( )( )( )0102103210233336333pdppcpppbppppadcbax=+−=+−=+−+−=+++= ttt[ ]⋅−−−−=⋅=32102300010033036313311ppppdcbadcbax tttCubic Matrix Form[ ][ ]⋅−−−−⋅=⋅−−−−⋅=zyxzyxzyxzyxpppppppppppptttttt333222111000233210230001003303631331100010033036313311xppppxMatrix Form[ ]CtxGBtxx⋅=⋅⋅=⋅−−−−⋅=BezBezzyxzyxzyxzyxppppppppppppttt3332221110002300010033036313311Matrix FormWe can rewrite the equations in matrix formThis gives us a compact notation and shows how different forms of cubic curves can be relatedIt also is a very efficient form as it can take advantage of existing 4x4 matrix hardware support…DerivativesFinding the derivative (tangent) of a curve is easy:cbaxdcbax ++=+++= ttdtdttt 23223[ ] [ ]⋅=⋅=dcbaxdcbax


View Full Document

UCSD CSE 167 - Cubic Curves

Documents in this Course
Lighting

Lighting

38 pages

Review

Review

59 pages

Surfaces

Surfaces

22 pages

Review

Review

110 pages

Midterm

Midterm

4 pages

Lighting

Lighting

38 pages

Lighting

Lighting

71 pages

Review

Review

110 pages

Lighting

Lighting

71 pages

Load more
Download Cubic Curves
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Cubic Curves and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Cubic Curves 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?