Interactive Computer Graphics - Assignment 9

Picking


Topics:



  1. Write a program that displays three smooth-shaded triangle-mesh objects using perspective projection. The objects should not spatially overlap and all three should be visible when the program starts up. Each object should have a different surface color. Attach a light source to the camera, i.e. define a static light in camera coordinates.
  2. Allow the user to change the view of the geometric objects, and provide a way for the user to reset the initial view. The user should be able to visually overlap the three objects.
  3. The user should be able to click on the geometric objects. When clicked, the object's diffuse color should change to some random value.

Picking should be implemented by rendering to an off-screen frame buffer object with each geometric object having a unique constant color, i.e. with no shading. Once the user clicks the mouse, get the pixel color at the click location and use the color to identify the clicked-on object. Be sure to also draw to the on-screen frame buffer.

Your program should look something like this video.


Grading Scheme

  1. Displaying three smooth-shaded triangle-mesh objects: 1 point
  2. Changing and resetting camera view: 1 point
  3. Display should allow the three objects to visually overlap: 1 point
  4. Off-screen depth-buffering implemented correctly: 2 points
  5. Object's color changes when clicked on: 5 points

Last modified March 22, 2024.