EXERCISES FOR WEEK 11
| week11-1 |
Select the file /classes/cs3014/files/Textures/birchtree.ppm,
or any of
the others. Or, use one of your own. Write a small
program that will
draw a rectangle and texture it with birchtree.ppm.
|
| week11-2 | Create your own texture by designing your initial(s) in a bitmap image. Apply the image to an object. |
| week11-3 | Apply a texture to a sphere. Use glu
quadrics for the sphere instead of glutsphere
so that the texturemapping will be more or less automated.
|
| week11-4 | Refer to the Orientation
of the Quadric Sphere page and use this information from the OpenGL
Programming Guide:
void gluSphere(GLUquadricObj *qobj, GLdouble radius, GLint
slices, GLint stacks); If texture coordinates are also generated by the quadrics facility, the t-coordinate ranges from 0.0 at z = -radius to 1.0 at z=radius, with t increasing linearly along longitudinal lines. Meanwhile, s ranges from 0.0 at the +y axis, to 0.25 at the +x axis, to 0.5 at the -y axis, to 0.75 at the -x axis, and back to 1.0 at the +y axis. Sketch the sphere and label the points on the sphere that these texels get mapped to:
Assume lower left corner of texel map is (s,t) = (0,0) and upper right
corner is (s,t) = (1,1). |