OpenGL 3:
The objective of this lab is to introduce you to “GLU” objects, error handling, and texture mapping.
The “resolution” of the sphere is controlled by the stacks and slices parameters. When you are done with the sphere call glDeleteQuadric(sphereHandle).
You should download opengl3.cpp, bmp.cpp, bmp.h, and myTexture.bmp. Create a new win32 application, insert these files, and build an executable. The program creates a scene with a red sphere and a texture mapped triangle.
What you should do:
1. To texture map the sphere you should
a. Add gluQuadricTexture(theSphere,GL_TRUE); just before the glueSphere call in BuildSphere().
b. Enable textures before the sphere is drawn in Render().
2. GLU supports a variety of 3D objects and you should try them out. Following are the function prototypes
a. void gluCylinder(GLUquadricObj *qobj, GLdouble radius,
GLint slices, GLint stacks);
b. void gluDisk(GLUquadricObj *qobj, GLdouble innerRadius,
GLdouble outerRadius, GLint slices, GLint rings);
c. void gluPartialDisk(GLUquadricObj *qobj, GLdouble innerRadius,
GLdouble outerRadius, GLint slices, GLint rings,
GLdouble startAngle, GLdouble sweepAngle);
3. You can also change the drawing style for these objects using gluDrawStyle(GLUquadricObj *qobj, GLenum drawStyle); where drawStyle is a GL enumerated type: GLU_POINT, GLU_LINE, GLU_SILHOUTTE, GLU_FILL. Try each of these styles.