1 / 24

CHAPTER 10 Curves and Surfaces

CHAPTER 10 Curves and Surfaces. by Richard S. Wright Jr. Vivian. Objectives. Introduce OpenGL evaluators Learn to render polynomial curves and surfaces Discuss quadrics in OpenGL - GLUT Quadrics - GLU Quadrics. What Does OpenGL Support?.

rayya
Download Presentation

CHAPTER 10 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. CHAPTER 10 Curves and Surfaces by Richard S. Wright Jr. • Vivian

  2. Objectives • Introduce OpenGL evaluators • Learn to render polynomial curves and surfaces • Discuss quadrics in OpenGL - GLUT Quadrics - GLU Quadrics

  3. What Does OpenGL Support? • Evaluators: a general mechanism for working with the Bernstein polynomials - Can use any degree polynomials - Can use in 1-4 dimensions - Automatic generation of normals and texture coordinates - NURBS supported in GLU • Quadrics • GLU and GLUT contain polynomial approximations of quadrics

  4. Quadrics

  5. Quadrics • Void gluQuadricDrawStyle(GLUquadricObj *obj, GLenum drawStyle); • void gluQuadricNormals(GLUquadricObj *pbj, GLenum normals);

  6. Draw a quadrics • Draw a sphere: • void gluSphere(GLUQuadricObj *obj, GLdouble radius, GLint slices, GLint stacks);

  7. Draw a quadrics void gltDrawUnitAxes(void)

  8. Curves and Surfaces Overview • What is a parametric curve/surface? • Why use parametric curves & surfaces? • Bézier curves & surfaces • NURBS • Trimmed surfaces • OpenGL library

  9. What is a parametric curve? 2D parametric curve takes the form y = mx + b x y f(t) g(t) Where f(t) and g(t) are functions of t = Example: Line thru points a and b (1-t) ax + t bx (1-t) ay+ t by x y = Mapping of the real line to 2D: here t in [0,1]  line segment a,b

  10. What is a parametric curve? 3D curves defined similarly x y z f(t) g(t) h(t) = Example: helix x y z cos(t) sin(t) t =

  11. Parametric representation of curves and surfaces.

  12. Control Points The order of the curve is represented by the number of control points used to describe its shape. The degree is one less than the order of the curve.

  13. Bézier Curves Examples linear: b(t) = (1-t) b0 + t b1 n=1 quadratic: b(t) = (1-t)2b0 + 2(1-t)t b1 + t2b2 n=2 cubic: b(t) = (1-t)3b0 + 3(1-t)2 t b1 + 3(1-t)t2b2 + t3b3 n=3 Bernstein basis Bin (t) = {n!/(n-i)! i!} (1-t)n-i ti

  14. Continuity

  15. Bézier Curves in OpenGL Basic steps: • Define curve by specifying degree, control points and parameter space [u0,u1] • Enable evaluator • Call evaluator with parameter u in [u0, u1] glMap1*() Autocreate uniformly spaced u:glMapGrid1*() glEvalMesh1() Specify each u: glEvalCoord1*() or Color and texture available too!

  16. What is a parametric surface? 3D parametric surface takes the form Where f,g,h are bivariate functions of u and v x y z f(u,v) g(u,v) h(u,v) = Example: x(u,v) = u v u2 + v2 mapping u,v-space to 3-space; this happens to be a function too

  17. Bézier Surfaces in OpenGL Basic steps: • Define curve by specifying degree, control points and parameter space [u0,u1] • Enable evaluator • Call evaluator with parameter u in [u0, u1,v0 , v1] glMap2*()

  18. Bézier Surface Multiple patches connected smoothly Conditions on control netsimilar to curves … difficult to do manually

  19. NURBS Non-uniform Rational B-splines B-splines are piecewise polynomials One or more Bezier curves /surfaces One control polygon Rational: let’s us represent circles exactly GLU NURBS utility

  20. From Bézier to B-Splines

  21. Creating a NURBS Surface • Evaluator →NURBS • Knots

  22. Trimming

  23. Trimmed Surfaces Parametric surface with parts of the domain “invisible” Surf Lab domain Jorg Peters’ UFL group GLU Trimmed NURBS utility

More Related