Quadrics ray wisman rwisman@ius edu
This presentation is the property of its rightful owner.
Sponsored Links
1 / 5

Quadrics Ray Wisman [email protected] PowerPoint PPT Presentation


  • 76 Views
  • Uploaded on
  • Presentation posted in: General

Quadrics Ray Wisman [email protected] . 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

Download Presentation

Quadrics Ray Wisman [email protected]

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Quadrics ray wisman rwisman@ius edu

QuadricsRay Wisman [email protected]


Objectives

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


Quadrics

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


Quadrics1

Quadrics

  • Normals for shading

    gluQuadricNormals(qobj, GLU_SMOOTH);

  • Drawing style

    gluQuadricDrawStyle(qobj,GLU_LINE);

  • Texture coordinates

    gluQuadricTexture(qobj,GL_TRUE);

OpenGL Game Programming


Cylinders and cones

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


  • Login