1 / 5

Quadrics Ray Wisman rwisman@ius

Quadrics Ray Wisman rwisman@ius.edu . Objectives. Introduce quadrics Definition quadric – an object having state about how the shape should be drawn; the state does not contain the geometric shape but describes how to draw the shape. Introduce tessellators

hashim
Télécharger la présentation

Quadrics Ray Wisman rwisman@ius

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. QuadricsRay Wisman rwisman@ius.edu

  2. Objectives • Introduce quadrics • Definition quadric – an object having state about how the shape should be drawn; the state does not contain the geometric shape but describes how to draw the shape. • Introduce tessellators • Definition tessellate – To form into a mosaic pattern as by using small squares of stone or glass OpenGL Game Programming

  3. Quadrics • Define a quadric variable GLUquadric *qobj; • Create a quadric object qobj = gluNewQuadric(); • Draw quadric sphere radius ½, 50 longitude and latitude lines centered at origin. gluSphere(qobj,.5,50, 50); • Delete gluDeleteQuadric( obj ); OpenGL Game Programming

  4. Quadrics • Normals for shading gluQuadricNormals(qobj, GLU_SMOOTH); • Drawing style gluQuadricDrawStyle(qobj,GLU_LINE); • Texture coordinates gluQuadricTexture(qobj,GL_TRUE); OpenGL Game Programming

  5. Cylinders and cones glRotatef(90,1,0,0);glRotatef(35,0,1,0); glTranslatef( 0,0, -1.0); GLUquadric *pencil = gluNewQuadric(); gluQuadricNormals(pencil, GLU_SMOOTH); gluCylinder(pencil, .2, .2, 3, 12, 2); glDisable(GL_LIGHTING); glColor3f(.7,.5,0); glTranslatef( 0,0,-.3); gluCylinder(pencil, .2, .2, .3, 12, 2); // Eraser glEnable(GL_LIGHTING); glTranslatef( 0,0, 3.3); gluCylinder(pencil, .2, .0, .3, 12, 2); // Cone writing end OpenGL Game Programming

More Related