Page 2: Mesh Exercise

CS559 Spring 2021 Sample Solution - Workbook 9

Written by CS559 course staff

You can try out the example solutions here. The interesting code is on page 5, page 6 and page 7.

In the world below (files 09-02-01.html and 09-02-01.js) make three objects and place them into the world so all can be seen.

They can be anything. They just must have 3 or more triangles, and you have to make each one from a Geometry and put them into the 559 Framework. You can even use the objects from later parts of the assignments (pages 6 and 7) if they fulfill the requirements.

  1. One object must have face coloring where we can see triangles with different colors.
  2. One object must have vertex coloring where we can see the colors smoothly varying across a triangle boundary.
  3. One object must have vertex normals set so the lighting is smooth across a triangle boundary.

There are examples of face coloring, vertex coloring, and fake normals to get smooth lighting on page 1. You can look at that code to understand how to make these different kinds of things.

You may not use an object loader for this exercise: you must build the Geometry object in JavaScript code.

The other requirement is that it should be visibly obvious which object fills which requirement. The smooth normals might require rotating it to see.

This page is meant to be practice for the bigger exercises on pages 5, 6 and 7.

After you’ve done it, go on to Page  3  (Texture Basics).

Next: Texture Basics

Page 2 Rubric (15 points total)
Points (15):
Box 09-02-01
2 pt
Object 1 has (at least) 3 triangles
Box 09-02-01
2 pt
Object 1 has face colors
Box 09-02-01
2 pt
Object 2 has (at least) 3 triangles
Box 09-02-01
3 pt
Object 2 had vertex colors where we can see blending
Box 09-02-01
2 pt
Object 3 has (at least) 3 triangles
Box 09-02-01
3 pt
Object 3 has normals that make things look smooth
Box 09-02-01
1 pt
Code Check: objects build “manually”