CG Homework 6, due Thu 2016-10-13 9am
-
(20) Extend your program from last week that displays the Starship Enterprise as follows:
- For each triangle, compute its surface normal in the .js file.
- Use that normal to compute a color for the triangle. Make the red component proportional to the X component of the normal. Make .. green .. y, blue .. z.
- Attend each triangle's color to its 3 vertices and send that to the vertex shader.
- Color the triangles accordingly. In this simple exercise, each triangle's color will be flat.
- Now you should start to be able to see the 3D object.
(Total: 20 points.)