/** Surface properties, this base class does a single color, * extend class and override getColor for fancy 3D textures * (should use surface mapping instead for moving objects) * @author: Phil Gage */ class Material { Color color; // base color double kd = 1.0; // diffuse reflection coefficient double ks = 0.0; // specular reflection coefficient double kt = 0.0; // transmission coefficient double ir = 1.0; // index of refraction double specular = 0.0; // Phong specular highlight exponent Material (Color color) { this.color = color; } /** Return material color at a point, override for textures */ Color getColor (Point point) { return color; } }