### Professor Harriet Fell

#### Introduction

In this assignment, you will project an icosahedron onto the display plane and then implement one or more methods to shade the image.

#### What you shoud do and turn in

1. Preparation:
If you don't already have it, get vecmath.jar from from /course/csu540/CodeSamples.
• Get the folder TriangleMesh from /course/csu540/CodeSamples.
• Make sure you can run the Triangle mesh program. Use the keys 'x', 'y', and 'z' to rotate the tetrahedron about the corresponding axes.
2. Create an Icosahedron class to replace the Tetrahedron class.
• Use your model to get the correct vertices for the 20 triangle faces.
• Make sure that you order the vertices for each face counterclockwise as you look at the icosahedron from the outside.
• Your vertex coordinates should be of the form (0, +/-100, +/-100phi), (+/-100phi, 0, +/-100), or (+/-100, +/-100phi, 0).
• Set all the face colors to the same value (e.g. all red or all blue). Do not use black.
• Shade your icosahedron as if there is a light source at (600, 0, 1200).
To do this, for each visible face, compute the cosine of the angle between the face normal vector and a vector from the center of the face toward the light. If both these vectors are normalized, you just need to take their dot product to get the cosine. Multipy the R,G,B components of the face color by this cosine before you paint the projected triangle.
• (Optional) Add a way to move the light source.
4. (All Optional)
• Replace your icosahedron with a geodesic sphere structure, see VB: HowTo: Make a Geodesic Sphere

These grading guidelines will be used for all programming assignments:

• Main Program
• correctness (70%)
• style of your program (10% )
• documentation:

#### Submit the following:

• a printout of your code.
• a printout of a readme that explains how to run your program.
• soft copy of the code that can be compiled.

Email your zipped work as an attachment to fell@ccs.neu.edu with Subject: CSG540-First3D.

Last Updated:

Harriet Fell
College of Computer Science, Northeastern University
360 Huntington Avenue #WVH-340,
Boston, MA 02115
Internet: fell@ccs.neu.edu
Phone: (617) 373-2198 / Fax: (617) 373-5121
The URL for this document is: http://www.ccs.neu.edu/home/fell/CSU540/programs/First3DProject.html