CMPS 160 -- Lab Assignment 1
Due date:
midnight Friday, April 3, 2015
Objectives:
Get started with WebGL.
Description:
-
You are to familiarize yourself with 2 different starter programs,
run them individually, and then combine, modify and simplify them into one program.
-
The
first program
sets up a drawing canvas and gives it a background color.
-
The
second program
waits for the user to click 3 points on a blank canvas,
then draws a filled triangle with interpolated fill colors.
Each additional click creates a new triangle using the 2 previous
points as the other 2 points of the new triangle.
-
Your task is to combine them into a single WebGL program with the following requirements:
-
Change the color of the background.
-
Separate the javascript from the html file and save as a separate .js file.
-
Most importantly, try to simplify the code as much as possible so that it
simply draws a single triangle in the middle of the canvas (no clicking necessary).
Also, the triangle is to be drawn as an outline only with a single color --
the interior of the triangle is not to be filled in.
-
Add documentation to your combined code.
-
Lastly, do the submission process described below.
Grading:
This lab assignment will form part of your CMPS 160L grade.
The other component of CMPS 160L grade is your attendance.
Here's what I told graders about grading this assignment:
"do add a comment to explain why they have less than perfect score. e.g.
missing comment block (-5 for html and -5 for js), or if code still looks
very complicated (-10 if it has extraneous stuff like handling mouse events
or unused libraries for matrix/vectors..), or -10 if no inline comments for
gl calls inside js file.
also -50 if does not show a simple triangle wireframe."
Who graded your assignment:
jiayu: ahosick -- jbernay
matthew: jchen160 --tmlinejo
Submission:
Submission must be done using the "submit" command from unix.ic.ucsc.edu
- submit cmps160-ap.s15 lab1 lab1.tar, or
- submit cmps160-ap.s15 lab1 lab1.zip
This command should work from unix.ic.ucsc.edu.
Create and submit a subdirectory called lab1.
It should contain your html file and your javascript file.
Tar or zip up lab1 before submitting.
Last modified
Saturday, 04-Apr-2015 09:59:22 PDT.