Syllabus   Blank Homework   Quizzes  
Notes   Labs   Scores   Blank

Lab 3, due 1/30/19 (Wed), 6 pm
Dr. Tong Lai Yu

Color Shader

  1. Write a shader program that displays 3 colored triangles with different colors, using one of the colors red, green and blue for each triangle. When you press the key 't', the color of each triange toggles from one to another.
  2. In the above program, the triangles tranforms according to:
    1. expand when pressing 'e'; contracts when press 'c';
    2. rotate 2o anticlockwise about x-axis when pressing 'x'; about y-axis when pressing 'y' and about z-axis when pressing 'z'; they rotate clockwise respectively if pressing the capital letter keys 'X', 'Y' and 'Z'.

Compile and run the program.

  • Write a report that shows all your work; make sample screen shots of your graphics outputs of the problem. Comment on and self-evaluate your work; state explicilty whether you have finished each part successfully! If you have finished all parts succussfully, give yourself 20 points, otherwise deduct some points that you feel apropriate. The instructor may adjust your score depending on your submitted report.

    Note: All your work must be saved in pdf file format and submitted online! Typically, your submitted pdf file should should consist of the source code you write that is highlighted. It should also have a screen shot of the output of the program. (But do not use screen shot for text outuput, including source code.) You must also put down your name but not your student ID in your submitted report. To submit your lab, you must first login by choosing your name, entering your student id, and clicking Login below.

    Choose your name:
    Enter your student id (xxxxxxxxx):