advanced computer graphics advanced computer graphics cs
play

Advanced Computer Graphics Advanced Computer Graphics CS 563: Curves - PowerPoint PPT Presentation

Advanced Computer Graphics Advanced Computer Graphics CS 563: Curves and Curved Surfaces William DiSanto Computer Science Dept. Worcester Polytechnic Institute (WPI) O Overview i Advantages/Disadvantages / Implicit Surfaces


  1. Advanced Computer Graphics Advanced Computer Graphics CS 563: Curves and Curved Surfaces William DiSanto Computer Science Dept. Worcester Polytechnic Institute (WPI)

  2. O Overview i  Advantages/Disadvantages /  Implicit Surfaces  Parametric Paths  Parametric Surfaces  NURBS  Demos  Demos

  3. Wh U Why Use Curves? C ?  Compact Representation  Control Points, Knots, Weights  Usually Scale/Rotation/Translation Invariant y  Smooth well Defined Derivatives  Good for paths p  Curves can represent triangle mesh exactly  Support surfaces of arbitrary dimension  Support surfaces of arbitrary dimension

  4. Disadvantages to Curved Surfaces Di d t t C d S f  Can be difficult to implement  Expensive to render  Hard to fit Hard to fit  Few SW packages support diverse features needed needed  Often reduced to tri ‐ mesh anyway  Subdivision surfaces may suffice  Subdivision surfaces may suffice  Extraordinarily unintuitive to manipulate  Hard for artists to edit in a precise manner d f i di i i  Some artists prefer since its reliably scalable (scan in)

  5. I Implicit Surfaces li it S f Blending

  6. P Parametric Curves t i C  Each coordinate is expressed as and explicit function of some independent parameters Parametric Linear Curve Parametric Linear Curve

  7. Bé i Bézier Curves C  Curves from repeatedly linear interpolation on control points  Curve will have continuity = # of control points – 2  Can be expressed as a recurrence over control points Quadratic Curve from Control Points (a,b,c), t = 1/3

  8. Bé i Bézier Curves C  Curves tend to remain in the convex hull of the control points  Curves tend to remain in the convex hull of the control points  Notice the entire curve is effected by every single control point Except for position at t = 0.0 and t = 1.0 p p  Cubic Bézier Curve

  9. d C de Casteljau Algorithm t lj Al ith  Generate a tree of linear interpolation points  Generate a tree of linear interpolation points originating from the point on the curve at time t

  10. B Bernstein Polynomials t i P l i l  Algebraic Form for Bézier Curve  Algebraic Form for Bézier Curve Same as before

  11. B Bernstein Polynomials t i P l i l  Polynomials can be pre ‐ computed and used later  Binomial coefficient may make solution unstable for large numbers of control point

  12. R ti Rational Bézier Curves l Bé i C  Use weighted ratio of Bernstein Polynomials  Rational Functions Allow for representation of conic curves Example: Unit Circle  Can find weights by substitution Quadrant of unit circle represented with Bézier Curve

  13. H Homogenous Coordinates C di t  View Rational Polynomial as n ‐ dimensional non ‐ rational polynomial projected into n+1 dimensional space polynomial projected into n+1 dimensional space Perspective projection looking down the n+1 th dimensional axis  Project onto W = 1   Computationally efficient representation

  14. Bé i Bézier Curves on GPU (filled) C GPU (fill d)  Map control points to canonical texture space  Texture coordinates are interpolated on hardware  Test per ‐ pixel texture coordinates against algebraic expression of the curve to shade

  15. Pi Piecewise Bézier Curves i Bé i C  Curves can be joined together  Edge control points must match  Internal points must be positioned to preserve continuity C 0 G 1 (Tangent DirectionMatch) C 1

  16. C bi H Cubic Hermite Interpolation it I t l ti  Spline controlled by 2 control points and 2 tangents  In general values and some derivatives at sample points must be known

  17. K Kochanek ‐ Bartels Curves h k B t l C  Stitch together Cubic Hermite splines  Tension parameter (controls pinching at point)  Bias parameter (biases hump before/after i th point)  No tension and no bias produces Catmull ‐ Rom spline

  18. K Kochanek ‐ Bartels Curves h k B t l C  Can define both input and output tangents per point  Another parameter (continuity)  Determines how much in/out tangents agree  Can be used to make sharp corners a = tension a tension b bias c continuity b = bias c = continuity

  19. Bé i Bézier Patches P t h  Bi ‐ linearly Interpolate between control points  Bi linearly Interpolate between control points

  20. Bé i Bézier Patches P t h Generate Interpolation Points within Quads

  21. B Bernstein Patches t i P t h Different Degrees in each Dimension Possible

  22. D Derivatives i ti  Derivatives and normals well defined D i ti d l ll d fi d

  23. Bé i Bézier Patches P t h  Below: Control points, connected points and B l C t l i t t d i t d normals sampled from the patches, and a render of the computed quads of the computed quads

  24. Bé i Bézier Patches P t h Manipulation of Control Points

  25. R ti Rational Bézier Patches l Bé i P t h  Surface still contained within convex hull

  26. Bé i Bézier Triangles T i l  Interpolate with barycentric coordinates

  27. B Bernstein Triangles t i T i l

  28. Bé i Bézier Triangle: Representations T i l R t ti  de Casteljau  de Casteljau  Bernstein  Bernstein  Derivatives

  29. N P t h N ‐ Patches  Generate smooth LOD mesh with N ‐ Patches  Each triangle generate 4 internal triangles

  30. N P t h N ‐ Patches  Quadratic interpolation of normals used to handle inflections

  31. C Continuity ti it  When connecting Bézier patches points next to  When connecting Bézier patches, points next to the boundary must be collinear to preserve C 1

  32. C Continuity ti it Discontinuous Continuous

  33. C Continuity ti it  G continuity if points adjacent to shared corner  G 1 continuity if points adjacent to shared corner lie in a plane  At patch corners vertical and horizontal control  At patch corners vertical and horizontal control points must be spaced at equal rations for C 1

  34. B Basis ‐ Splines i S li  Offer Local Control  Can be expressed as Bézier curves  Suppress Error for many control points Suppress Error for many control points  Continuity controlled for any number of points*

  35. K Knot Vectors t V t  Describe set of basis functions (from Cox ‐ de Boor)  Knot values can be repeated to reduce the span of a basis function  Need not be integer valued  Need not be integer valued

  36. Knot Vectors: Non ‐ Uniform Example K V N U if E l

  37. NURBS NURBS  Knot vectors can take on values that are not uniformly spaced  Use Rational B ‐ Splines

  38. NURBS T NURBS Texturing t i  Map parameters to texture [0,1] p p [ , ]  texcpts = [0, 0, 0, 1, 1, 0, 1, 1] gluBeginSurface(globj); gluNurbsSurface(globj 4 U 4 V 4 2 texcpts 2 2 gluNurbsSurface(globj, 4, U, 4, V, 4, 2, texcpts, 2, 2, GL_MAP2_TEXTURE_COORD_2); gluNurbsSurface(globj n + p + 1 U m + q + 1 V 3 gluNurbsSurface(globj, n + p + 1, U, m + q + 1, V, 3 m, 3, cpts, p + 1, q + 1, GL_MAP2_VERTEX_3); gluEndSurface(globj); gluEndSurface(globj);

  39. S Some Demos D Run Demos

  40. References  Real ‐ Time Rendering by Tomas Akenine ‐ Möller, Eric H i Haines, and Naty Hoffman, from A.K. Peters Ltd., 3rd d N H ff f A K P L d 3 d edition .  L. Piegl and W. Tiller, The NURBS Book (Monographs L Piegl and W Tiller The NURBS Book (Monographs in Visual Communication), 2nd ed.  NURBS Textures Peter Salvi June 30 2008  NURBS Textures, Peter Salvi, June 30, 2008

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