to do to do computer graphics fall 2005 computer graphics
play

To Do To Do Computer Graphics (Fall 2005) Computer Graphics (Fall - PDF document

To Do To Do Computer Graphics (Fall 2005) Computer Graphics (Fall 2005) Start on HW 2 (cannot be done at last moment) This (and previous) lecture should have all information need COMS 4160, Lecture 7: Curves 2


  1. To Do To Do Computer Graphics (Fall 2005) Computer Graphics (Fall 2005) � Start on HW 2 (cannot be done at last moment) This (and previous) lecture should have all information need COMS 4160, Lecture 7: Curves 2 http://www.cs.columbia.edu/~cs4160 � Start thinking about partners for HW 3 and HW 4 � Remember though, that HW2 is done individually � Your submission of HW 2 must include partner for HW 3 Outline of Unit Outline of Unit Idea of Blossoms/Polar Forms Idea of Blossoms/Polar Forms � (Optional) Labeling trick for control points and intermediate deCasteljau points that makes thing intuitive � Bezier curves (last time) � E.g. quadratic Bezier curve F(u) � deCasteljau algorithm, explicit, matrix (last time) � Define auxiliary function f(u 1 ,u 2 ) [number of args = degree] � Points on curve simply have u 1 =u 2 so that F(u) = f(u,u) � Polar form labeling (blossoms) � And we can label control points and deCasteljau points not � B-spline curves on curve with appropriate values of (u 1 ,u 2 ) f(0,1)=f(1,0) � Not well covered in textbooks (especially as taught here). Main reference will be lecture notes. If you do f(u,u) = F(u) want a printed ref, handouts from CAGD, Seidel f(0,0) = F(0) f(1,1) = F(1) Idea of Blossoms/Polar Forms Idea of Blossoms/Polar Forms Geometric interpretation: Quadratic Geometric interpretation: Quadratic 01=10 � Points on curve simply have u 1 =u 2 so that F(u) = f(u,u) u � f is symmetric f(0,1) = f(1,0) 1u � Only interpolate linearly between points with one arg different 1-u � f(0,u) = (1-u) f(0,0) + u f(0,1) Here, interpolate f(0,0) and f(0,1)=f(1,0) 1-u u uu f(0,1)=f(1,0) 00 01 11 0u u 1-u u 1-u u 0u 1u 1-u u 00 11 f(u,u) = F(u) uu F(u) = f(uu) = (1-u) 2 P0 + 2u(1-u) P1 + u 2 P2 f(0,0) = F(0) f(1,1) = F(1)

  2. Geometric Interpretation: Cubic Polar Forms: Cubic Bezier Curve Polar Forms: Cubic Bezier Curve 001 011 001 0u1 011 uu1 111 u11 000 000 001 011 111 uuu 1-u u 1-u u u 1-u 0uu 00u 01u 11u 00u 1-u u 1-u u 0uu 1uu u 1-u 000 111 uuu Why Polar Forms? Why Polar Forms? Subdividing Bezier Curves Subdividing Bezier Curves � Simple mnemonic: which points to interpolate and how in Drawing: Subdivide into halves (u = ½) Demo: hw2.exe deCasteljau algorithm � Recursively draw each piece � At some tolerance, draw control polygon � Trivial for Bezier curves (from deCasteljau algorithm): hence widely used for drawing � Easy to see how to subdivide Bezier curve (next) which is useful for drawing recursively 000 001 011 111 000 00u 0uu uuu uuu uu1 u11 111 � Generalizes to arbitrary spline curves (just label control points correctly instead of 00 01 11 for Bezier) Why specific labels/ control points on left/right? � How do they follow from deCasteljau? � Easy for many analyses (beyond scope of course) Geometrically Geometrically 001 0½1 011 001 0½1 011 ½½½ ½½½ 0½½ 0½½ ½½1 ½½1 00½ 00½ ½11 ½11 000 000 111 111

  3. Summary for HW 2 Subdivision in deCasteljau Subdivision in deCasteljau diagram diagram Summary for HW 2 001 011 � Bezier2 (Bezier discussed last time) � Given arbitrary degree Bezier curve, recursively subdivide 111 000 These (interior) points don’t for some levels, then draw control polygon hw2.exe appear in subdivided curves at all � Generate deCasteljau diagram; recursively call a routine 000 001 011 111 with left edge and right edge of this diagram 1-u u 1-u u u 1-u 00u 01u 11u � You are given some code structure; you essentially just Left part of Bezier curve Right part of Bezier curve need to compute appropriate control points for left, right 1-u u 1-u u (uuu, 1uu, 11u, 111) (000, 00u, 0uu, uuu) 0uu 1uu Always left edge of Always right edge of deCasteljau pyramid deCasteljau pyramid u 1-u uuu DeCasteljau: Recursive Subdivision : Recursive Subdivision Outline of Unit Outline of Unit DeCasteljau � Bezier curves (last time) � deCasteljau algorithm, explicit, matrix (last time) � Polar form labeling (blossoms) � B-spline curves � Not well covered in textbooks (especially as taught � DeCasteljau (from last lecture) for midpoint here). Main reference will be lecture notes. If you do � Followed by recursive calls using left, right parts want a printed ref, handouts from CAGD, Seidel Bezier: Disadvantages Bezier: Disadvantages B- B -Splines Splines � Cubic B-splines have C 2 continuity, local control � Single piece, no local control (move a control point, whole curve changes) hw2.exe � 4 segments / control point, 4 control points/segment � Complex shapes: can be very high degree, difficult � Knots where two segments join: Knotvector � In practice, combine many Bezier curve segments � Knotvector uniform/non-uniform (we only consider � But only position continuous at join since Bezier curves uniform cubic B-splines, not general NURBS) interpolate end-points (which match at segment boundaries) � Unpleasant derivative (slope) discontinuities at end-points Knot: C 2 continuity Demo: hw2.exe � Can you see why this is an issue? deBoor points

  4. Polar Forms: Cubic Bspline Bspline Curve Curve deCasteljau: Cubic B : Cubic B- -Splines Splines Polar Forms: Cubic deCasteljau � Labeling little different from in Bezier curve � Easy to generalize using –1 0 1 0 1 2 polar-form labels � No interpolation of end-points like in Bezier � Impossible remember 1 2 3 -2 –1 0 � Advantage of polar forms: easy to generalize without –1 0 1 0 1 2 -2 -1 0 -1 0 1 0 1 2 1 2 3 ? ? ? ? ? ? Uniform knot vector: -2, -1, 0, 1, 2 ,3 -1 0 u 0 1 u 1 2 u Labels correspond to this 1 2 3 -2 –1 0 deCasteljau: Cubic B deCasteljau : Cubic B- -Splines Splines deCasteljau: Cubic B deCasteljau : Cubic B- -Splines Splines � Easy to generalize using –1 0 1 � Easy to generalize using –1 0 1 0 1 2 0 1 2 polar-form labels polar-form labels � Impossible remember � Impossible remember 1 2 3 1 2 3 -2 –1 0 -2 –1 0 without without -2 -1 0 -1 0 1 0 1 2 1 2 3 -2 -1 0 -1 0 1 0 1 2 1 2 3 (2+u)/3 (2+u)/3 (1-u)/3 (1-u)/3 (1+u)/3 (1+u)/3 (2-u)/3 (2-u)/3 1-u/3 u/3 1-u/3 u/3 -1 0 u 0 1 u -1 0 u 0 1 u 1 2 u 1 2 u (1+u)/2 (1-u)/2 ? ? ? ? 1-u/2 u/2 0 u u 1 u u 0 u u 1 u u 1-u u u u u Summary of HW 2 Summary of HW 2 Explicit Formula (derive as exercise) Explicit Formula (derive as exercise)  P 0  − − � BSpline Demo hw2.exe  1 3 3 1  1   =   M M P 1 − 3 6 3 0     = 3 2 � Arbitrary number of control points / segments F u ( ) [ u u u 1] 6  −    3 0 3 0 P 2 � Do nothing till 4 control points (see demo)     1 4 1 0   � Number of segments = # cpts – 3 P 3   P0 P1 P2 � Segment A will have control pts A,A+1,A+2,A+3 P3 -2 -1 0 1 2 3 -1 0 1 0 1 2 � Evaluate Bspline for each segment using 4 control (1-u)/3 (2+u)/3 points (at some number of locations, connect lines) (1+u)/3 (2-u)/3 u/3 1-u/3 -1 0 u 0 1 u 1 2 u � Use either deCasteljau algorithm (like Bezier) or (1-u)/2 (1+u)/2 explicit form [matrix formula on previous slide] 1-u/2 u/2 0 u u 1 u u � Questions? 1-u u u u u

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend