Page 2: Mesh Exercise

CS559 Spring 2023 Sample Solution

In the world below (files 08-02-01.html and 08-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 BufferGeometry and put them into the 559 Framework. You can even use the objects that you’ll make for 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. With BufferGeometry you need to split the vertices. Each triangle should be one color and triangles with different colors should share an edge.
  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. For this page, you cannot use Texturing (that will come soon enough).

You may not use an object loader for this exercise: you must build the BufferGeometry object in JavaScript code. You need to actually have the coordinates in your file (yes, you need to figure out the vertex positions, and have the triangles oriented correctly). It is OK to use computeVertexNormals.

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 (14 points total)
Points (14):
Box 08-02-01
2 pt
Object 1 has (at least) 3 triangles
Box 08-02-01
2 pt
Object 1 has colored triangles (with different colors)
Box 08-02-01
2 pt
Object 2 has (at least) 3 triangles
Box 08-02-01
2 pt
Object 2 has vertex colors where we can see blending
Box 08-02-01
2 pt
Object 3 has (at least) 3 triangles
Box 08-02-01
2 pt
Object 3 has normals that make things look smooth
Box 08-02-01
2 pt
Code Check: objects build “manually”