// An object must implement a Renderable interface in order to
// be ray traced. Using this interface it is straight forward
// 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
- Intersect itself with a ray
- Shade itself (determine the color it reflects along the given ray)