Renderable Interface

// An object must implement a Renderable interface in order to
// be ray traced. Using this interface it is straightforward
// to add new objects

abstract interface Renderable {
    public abstract boolean intersect(Ray r);
    public abstract Color Shade(Ray r, Vector lights, Vector objects, Color bgnd);
    public String toString();
}

Thus, each object must be able to

  1. Intersect itself with a ray
  2. Shade itself (determine the color it reflects along the given ray)
Lecture 19   Slide 15   6.837 Fall '00