Assignment 7: Texturing and Rendering Simple Objects in Computer Graphics - Prof. Christop, Assignments of Computer Graphics

An assignment for the introduction to computer graphics course, fall 2004 (22c:151). Students are required to load textures from ppm files, apply them to simple objects using opengl, and create textured infinite planes, cubes, and cones. The assignment includes instructions for each problem and extra credit tasks.

Typology: Assignments

Pre 2010

Uploaded on 09/17/2009

koofers-user-cil-1
koofers-user-cil-1 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Fall 2004
22C:151 Introduction to Computer Graphics
Assignment 7
Due: Thursday October 21th at 12:01am (Wednesday at midnight)
Goal: Understand how to load textures from a file, and use OpenGL to apply them to simple objects.
Problem 1 (5 points): Load a texture from a PPM file. This will involve reading a PPM file into memory in a format
OpenGL can understand. If you’re still having trouble understanding PPM files, please come talk to me, as the rest of
this assignment depends on successful completion of this part.
Problem 2 (5 points): Add a textured “infinite plane” to your program from Homework 6. This should act as a
“floor” in your scene, so it should be behind the lit object, but you should be able to see the horizon (where the black
background and the floor meet) from your viewpoint.
Use a checker pattern to texture the floor.
The complex object (bunny, cow, etc.) still needs to be lit using OpenGL lighting, but you should turn off
lighting when texturing the floor.
Infinite planes cannot be specified in OpenGL, so just use a very, very large quad.
Problem 3 (5 points): Add the ability (via menu or keystroke) to replace the illuminated object with a textured cube.
Put a different texture on each face of the cube. Allow the cube to be rotated via a trackball. Once again, illumination
should be turned off for this object.
Problem 4 (5 points): Add the ability (via menu or keystroke) to replace the illuminated object with a textured cone.
Specify texture coordinates for all triangles in the cone. Make sure to specify intelligent texture coordinates so that
we can clearly see the cone is textured. Allow the cube to be rotated via a trackball. Again, illumination should be
turned off for this object.
Extra Credit A (3 points): Come up with a technique to texture all the complex objects used in Assignment 6. This
should be at least a semi-intellegent approach that gives reasonable results. This should be selectable using a menu
option or keystroke, and we should be able to rotate the object via the trackball. Once again, illumination may be
turned off for this.
Extra Credit B (3 points): Only available in conjunction with Extra Credit A! For the complex objects used in
Assignment 6, allow both texturing and lighting to be applied at the same time. You should use your texturing
technique from Extra Credit A, yet still be able to see both specular highlights and the texture color.
NOTE: A “README” file is required in order to get full credit! It is worth the 2 or 3 minutes it takes to write such a
file, as it guarantees we know how to compile and run your program, and you can make note of any odd behavior or
strange bugs (which may mask required functionality).

Partial preview of the text

Download Assignment 7: Texturing and Rendering Simple Objects in Computer Graphics - Prof. Christop and more Assignments Computer Graphics in PDF only on Docsity!

Fall 2004

22C:151 Introduction to Computer Graphics

Assignment 7

Due: Thursday October 21th at 12:01am (Wednesday at midnight)

Goal: Understand how to load textures from a file, and use OpenGL to apply them to simple objects.

Problem 1 (5 points): Load a texture from a PPM file. This will involve reading a PPM file into memory in a format OpenGL can understand. If you’re still having trouble understanding PPM files, please come talk to me, as the rest of this assignment depends on successful completion of this part.

Problem 2 (5 points): Add a textured “infinite plane” to your program from Homework 6. This should act as a “floor” in your scene, so it should be behind the lit object, but you should be able to see the horizon (where the black background and the floor meet) from your viewpoint.

  • Use a checker pattern to texture the floor.
  • The complex object (bunny, cow, etc.) still needs to be lit using OpenGL lighting, but you should turn off lighting when texturing the floor.
  • Infinite planes cannot be specified in OpenGL, so just use a very, very large quad.

Problem 3 (5 points): Add the ability (via menu or keystroke) to replace the illuminated object with a textured cube. Put a different texture on each face of the cube. Allow the cube to be rotated via a trackball. Once again, illumination should be turned off for this object.

Problem 4 (5 points): Add the ability (via menu or keystroke) to replace the illuminated object with a textured cone. Specify texture coordinates for all triangles in the cone. Make sure to specify intelligent texture coordinates so that we can clearly see the cone is textured. Allow the cube to be rotated via a trackball. Again, illumination should be turned off for this object.

Extra Credit A (3 points): Come up with a technique to texture all the complex objects used in Assignment 6. This should be at least a semi-intellegent approach that gives reasonable results. This should be selectable using a menu option or keystroke, and we should be able to rotate the object via the trackball. Once again, illumination may be turned off for this.

Extra Credit B (3 points): Only available in conjunction with Extra Credit A! For the complex objects used in Assignment 6, allow both texturing and lighting to be applied at the same time. You should use your texturing technique from Extra Credit A, yet still be able to see both specular highlights and the texture color.

NOTE: A “README” file is required in order to get full credit! It is worth the 2 or 3 minutes it takes to write such a file, as it guarantees we know how to compile and run your program, and you can make note of any odd behavior or strange bugs (which may mask required functionality).