23.10.2014 Views

3D Objects in OpenGL

3D Objects in OpenGL

3D Objects in OpenGL

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GLU <strong>3D</strong> <strong>Objects</strong><br />

void gluCyl<strong>in</strong>der( GLUquadric qobj,<br />

double baseRadius, double topRadius,<br />

double height, <strong>in</strong>t slices, <strong>in</strong>t stacks);<br />

Draws a cyl<strong>in</strong>der oriented along the z-axis, with the base of the cyl<strong>in</strong>der at z = 0<br />

and the top at z = height. Like a sphere, the cyl<strong>in</strong>der is subdivided around the z-axis<br />

<strong>in</strong>to a number of slices and along the z-axis <strong>in</strong>to a number of stacks.<br />

baseRadius is the radius of the cyl<strong>in</strong>der at z = 0. topRadius is the radius of<br />

the cyl<strong>in</strong>der at z = height. If topRadius is set to 0, then a cone is generated.<br />

GLUquadric qobj = gluNewQuadric();<br />

gluQuadricDrawStyle(qobj, GLU_FILL);<br />

gluCyl<strong>in</strong>der(qobj, 0.5, 0.3, 1.0, 15, 5);<br />

16

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!