**This Sp1 is due by the end of Thursday, November 3rd**, emailed as
a jar, as in previous assignments. You've seen the
collected critiques
for PA3. Pay careful attention to the various successes and failings
noted there.

The basic idea:

Build two abutting cones from a collection of independent triangles, with the two vertexes of the cones on the z-axis and the base of each cone in the x,y plane, z=0. Much of the basics are shown in the following three sketches I did in class, and edited later:

- The basic arrangement of the two cones.
- How to rotate points to create vertices for triangles.
- Illumination of triangles - normals and ambient light.

**The details**

- Build one cone, then copy points to the other.
- Cone starts with two points, one on z-axis, other on x-axis.
- Rotate the x-point 2π/n creating the third vertex of the triangle.
- Create the triangle object with the vertices in the correct order.
- Make a copy of the triangle with copied vertices. Rotate each of the base vertices by 2π/n, creating the second triangle.
- Continue in this way until you have n triangles.
- Copy all these triangles to create the set for the opposite cone, but changing the z-axis point of each.
- Rearrange the order of the points in the triangles, if necessary, as you copy them, to assure they're in the right order to create outward normals in the second cone.
- Rotate all the points π/4 around the x or y axis, followed by a translation of the center of the cone pair to the center of the screen.
- Compute the normals for each triangle.
- Compute the brightness for each triangle face, including some constant ambient illumination.
- Ray trace the object twice, with different light directions.
- Start all this with n=3 (6 faces) because ray tracing will be linear in the number of faces. Then raise n and see how far you can go.

And finally: Be proud of your results! This is pretty advanced work for a beginning graphics course with code built from scratch.

Wire frames: Draw only the edges - no ray tracing required.

Constant illumination: Ray trace, but use only one color. Harlequin approach - each triangle a random color.

Empty code and javadoc. Empty method bodies, but with a returned value/object as needed.

Fancy stuff: Other variants could include different colors, two light sources, different ambient level, Two cone objects, especially if they intersect, extreme shapes, e.g. flat bottom.

Concept of convexity: "no (con)cavities" - pool ball is convex. Technically draw any chord from one point on the surface to any other point - it will be entirely in the interior. For a single convex object, ray tracing is not necessary. Only need to do "backface culling" - ignore any triangle, face, facet, whose normal is point away from the view direction.

Go to CSU540 home page. or RPF's Teaching Gateway or homepage