CS312 Lab 5: Textures

 

  1. Copy the demo executables texture from ~eeaton/public/cs312/handouts/gldemo to your own directory. Run.
  2. Write a program to display a texture mapped cube (all 6 sides).
    1. In the handouts directory, there is a sub directory containing textures in ppm format ~eeaton/public/cs312/handouts/ppm.
    2. ppm (Portable Pixel Map) is an image file format and you can find out more about it with the unix command "man ppm"
    3. ppms can come in one of two versions, an ASCII and a corresponding binary version (i.e. the color information stored as ASCII text or as binary). The ASCII format is easier to process (since it's human-readable), but is much larger and less space-efficient than the binary version.
    4. Most image viewer such as Gimp or Irfanview (Windows) can convert a ppm from binary to ASCII and the otherway around.  Some of the sample textures in the handouts directory come in both formats.  Use the code I provided in an e-mail earlier this week for reading in the ppm texture from a file.