1 / 34

Curves and Surfaces

Curves and Surfaces. CSE3AGR - Paul Taylor 2009. Polynomials of Degree n. Degree is equal to the highest exponent of a term. Higher exponents result in more and more possible curves A degree n Polynomial can represent all curves that can be represented by ANY <n polynomials. Linear x.

kieu
Download Presentation

Curves and Surfaces

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Curves and Surfaces CSE3AGR - Paul Taylor 2009

  2. Polynomials of Degree n • Degree is equal to the highest exponent of a term. • Higher exponents result in more and more possible curves • A degree n Polynomial can represent all curves that can be represented by ANY <n polynomials.

  3. Linear x • https://harmon-middle-school.wikispaces.com/file/view/Graph.psd.jpg

  4. Quadratic x2 • http://www.nipissingu.ca/calculus/tutorials/quadratics.html

  5. Cubic x3 • http://en.wikipedia.org/wiki/File:Polynomialdeg3.svg

  6. Quartic x4 • http://en.wikipedia.org/wiki/Quartic_equation

  7. Quintic x5 • http://en.wikipedia.org/wiki/File:Polynomialdeg5.png

  8. Representin’ Explicit Implicit Parametric

  9. Explicit • Solve the new state of the system based on its previous state

  10. Explicit • Just like in High-School • One variable is dependant, the other Independant • Y = f(x) • Eg: y = x2 • Sometimes the function is invertertable • X = g(y) • Eg: x = y(1/2)

  11. Problems Explicit Functions can fail on specific orientations!!! A Simple Line y = mx + c A Vertical Line all values of Y will only exist for 1 value of x

  12. A Circle • A circle is a curve with a constant rate of bending • The closest we can get using an explicit rep: • Y = (r2 + x2) • Y = -(r2 - x2) • Given 0 ≤ |x| ≤ r

  13. 3D Explicit Functions • We need two functions to represent a curve in 3D. • Given X we have 2 dependant variables: • Y = f(x) • Z = f(x)

  14. Explicit Surfaces • A Surface requires two independent variables Z = f( x, y)

  15. Pros & Cons of Explicits • Mathematically Perfect • But Mathematicians never had to render an infinite value!!! • A Good use of explicits is intersection testing • Did the ray Intersect the Circle? • r = (y2 + x2) • A sphere • r = -(z2 + y2 + x2)

  16. Implicit • Solve the new state of the system based on its previous state and the current state

  17. Implicits • F( x, y) = 0 In 2 Dimensions: A Line: Ax + by + c = 0 A Circle: x2 + y2 – r2 = 0

  18. Pros & Cons of Implicits Also very useful for membership testing. Eg: Does (3,7) belong to the curve? Curves must be described as the intersection of two curved surfaces. :-S Quadrics are a quadratic polynomial type of surface, which can be represented implicitly. - Quadrics are also simple to intersect with lines

  19. Parametric Equations These guys are pretty much the staple diet of Cg curves! Basically they are created using three related explicit functions

  20. Pros & Cons of Parametrics • Always solvable! • Great for cheating with pre-calculated Basis Matrices

  21. Joining Cubics • Continuity is what we need!! • We have two levels of continuity • Geometric and Parametric • Geometric is simply ‘it looks pretty good!’ • Parametric is where the continuity is perfectly defined. • Parametric Continuity infers geometric Continuity • This is not transient • We can create Geometric Continuity by slacking off on Parametric Equations

  22. 3 Levels of Cohesion • Level 0 • Both curves share a point in space • Level 1 • Both curves share the point in space and have tangents (Gradients) that point in the same direction. (matching Velocity in time based visualisation) • Level 2 • Both curves share the point in space and have tangents (Gradients) that point in the same direction with the same magnitude (matching velocity and acceleration in time based visualisation)

  23. Geometric Continuity Levels • G0 – Curves are Joined • G1 – First Derivatives are Proportional • G2 – First & Second Derivatives are Proportional

  24. Polynomial Continuity Levels • C0 – Curves are Joined • C1 – First Derivatives are Equal • C2 – First & Second Derivatives are Equal

  25. Hermite Form Curves • Specified by: • The 2 Endpoints • The Tangents at the endpoints • BothDirection and Velocity

  26. Bezier Form Curves

  27. Natural Cubic Spline • This type of spline can contain n control points • Generating the coefficients requires an n+1 square Matrix!!!

  28. Spline • A special mathematical function defined piecewise by polynomials • In Human Readable Format: • Joining Polynomials Together

  29. B-Spline is short for basis spline

  30. Non-Uniform Rational Basis Splines (NURBS)

  31. Lerping • It’s a bad name, but we need to do it! • Thus we can convert our curves to line segments, and surfaces to polygonsm • Remember that Quad patches may look easy, but may not turn out flat!!!

  32. Considerations • How large is the spline being represented? • How close is it to the screen? • How much time do you want to spend rendering? • Do you want to generate micro-polygons for a awesomely shaded image? (RenderMan style)

  33. Generating Normals whilst Lerping • Perpendicular line gradients have a product of -1 • Thus the normal x gradient = -1 • -1 / gradient = normal * In 1 axis only, you will need to accumulate and normalise the Vector!! (or is it already normalised??)

  34. References http://spec.winprog.org/curves/ http://graphics.cs.msu.ru/courses/cg99/notes/lect13/curves.htm

More Related