Lab 2: WebGL and Geometry
CS 445: Computer Graphics, Fall 2017


Due Date: be ready to demo at the beginning of lab Wednesday, Sept 13

Goals

As you probably noticed, the code can be very confusing. In each lab, you will be asked to focus on only a few parts of the code and to mostly ignore the rest. I realize that this can be frustrating but there isn't really another option if we want to get something up and running right away. In this lab, we focus our attention on the geometry.

Directions

Extra Credit Option

If you and your partner want more of a challenge (and have completed the lab and have demonstrated it to the instructor) you can try to generate geometry for steiner surfaces. Look at the equations that describe the function in terms of 2 parameters, u and v. You will need a nested loop over these 2 variables. For each (u,v), calculate the vertex.

To Hand In

Demonstrate your program in lab on the due date no later than the end of lab. Zip together the entire project that contains the running code for the Shapes program (please remove the Square and Cube folders which are not needed for the Shapes program). One partner should submit to WISE. Add standard JS comments and also comments containing the name of both partners at the top of all files (if you want to guarantee credit!).

Creating More Complex Shapes

One generally does not generate complex organic models directly in WebGL. Instead the models are either scanned (e.g. see The Stanford 3D Scanning Repository) or are modeled in programs such as Maya (and exported, e.g. to obj format). The ply and obj formats can then be read into your WebGL program. One can try to find Javascipt code to read ply and obj files, or you can write your own.


Dragon

Bunny

Buddha

Dog

Bust