Department of Computer Sciences Graphics – Fall 2005 (Lecture 12)Shapes and ScenesGeometric Modeling Techniques for Shapes• Non-Smooth Surfaces (Fractals, Polygon Soup)• Interactive and Editable free-form surfaces (Subdivision Splines, A-splines, NURBS)• Shell surfaces• Boolean Set (CSG) operations on Solids• Physically Based Procedural Modeling (Diffusion Modeling, Particle systems, Elasto-dynamics),The University of Texas at Austin 1Department of Computer Sciences Graphics – Fall 2005 (Lecture 12)ScenesGames, Movies, Advertisements, Scientific Discovery,• Natural and Artificial Terrains• Simulated Environments• Nano-worlds to Cosmo- WorldsThe University of Texas at Austin 2Department of Computer Sciences Graphics – Fall 2005 (Lecture 12)Curves and Surfaces Programming using OpenGL and GLUQuadrics support in GLUDefine a quadric object.GLUquadricObj*p;p=gluNewQuadric();Specify a rendering Style of Quadric. Example as a wireframe.gluQuadricDrawStyle(p,GLU_LINE);Example a cylinder with its length along the y-axisgluCylinder(p,BASE_RADIUS,BASE_RADIUS,BASE_HEIGHT,sample_circle,sample_height)sample_circle = number of pieces of the basesample_height = number of height piecesThe University of Texas at Austin 3Department of Computer Sciences Graphics – Fall 2005 (Lecture 12)B´ezier Curves and SurfacesSupport is available through 1D, 2D, 3D, 4D evaluators to compute values for the polynomialsused in B´ezier and NURBS.glMaplf(type,u_min,u_max,stride,order,point_array)type = 3D points, 4D points, RGBA colors, normals, indexed colors,1D to 4D texture coordinatesu_min <= parameter u <= u_maxstride = number of parameter values between curve segmentsorder = degree of polynomial + 1control polygon = defined by point_arrayExample an evaluator for a 3D cubic B´ezier curve defined over (0,1) with a stride of 3 andorder 4The University of Texas at Austin 4Department of Computer Sciences Graphics – Fall 2005 (Lecture 12)point data[]={...}glMaplf{GL_MAP_VERTEX_3,0.0,1.0, 3,4,data};Multiple evaluators can be active at the same time, and can be used to evaluate curves,normals, colors etc at the same timeTo render the B´ezier Curve over (0,1) with 100 line segmentsglEnable{GL_MAP_VERTEX_3};glBegin(GL_LINE_STRIP)for(i=0; i<100; i++) glEvalCoord1f((float) i/100.0);glEnd();See example OpenGL/GLU program on pg 618 Chap11 (also pg 522, Chap 10,3rd ed.) fordisplaying a teapot using B´ezier functions.For lighting / shading using a NURBS surface, when additionally needs surface normals.These could be generated automatically, usingglEnable(GL_AUTO_NORMAL)The University of Texas at Austin 5Department of Computer Sciences Graphics – Fall 2005 (Lecture 12)NURBS functions in GLU librarygluNewNurbsRenderer() - create a pointer to a NURBS objectgluNurbsProperty() - choose rendering values such as size oflines, polygons. Also enables a mode where the tesselated geometrycan be retrieved through the callback interfacegluNurbsCallBack() - register the functions to call to retreivethe tesselated geometric data or if you wish notification when anerror is encounteredgluNurbsCurve() gluNurbsSurface() - to generate and render-specify control points, knot sequence, order, and/or normals,texture coordinatesThe University of Texas at Austin 6Department of Computer Sciences Graphics – Fall 2005 (Lecture 12)Reading Assignment and NewsChapter 10, 467-568 and chapter 11 pages 600 - 622, of Recommended Text.Please also track the News section of the Course Web Pages for the most recentAnnouncements related to this course.(http://www.cs.utexas.edu/users/bajaj/graphics25/cs354/)The University of Texas at Austin
View Full Document