CS 425

Oct 24, 2007

Sample programs:
Texture picture used
The first program is the example of making your own texture and sticking it to a polygon. Checker.c
This is a program using an int array to hold multiple textures. This program has two textures, one read in from a file and one source code generated. The two polygons are mapped with the two textures. Two Images
This program creates the front polygon to a 2x2 tessellated polygon. Then maps the texture as a tiled texture across the four polygons. 4 polygons
This is the same program as above but the texture gets spread over all four polygons. 4 polygons one texture
This program has a cone, which is just a cylinder with a radius of zero for the top, and let's Opengl automatically generate texture coordinates and place the texture on the cone. textured Cone
To rotate a texture on a cone or sphere you can generate your own mapping points instead of using the automatic texture coordinate system like in the example above.
Personally I'd take the picture into Photoshop manipulate it and then use automatic texture coordinates.
Here is an example of animating a texture. Use any key and the picture will move across the polygon. Texture animation