Surface Object
class Surface {
public float ir, ig, ib; // surface's intrinsic color
public float ka, kd, ks, ns; // constants for phong model
public float kt, kr, nt;
private static final float TINY = 0.001f;
private static final float I255 = 0.00392156f; // 1/255
// constructor
public Surface(
float rval, float gval, float bval, // surface color
float a, // ambient coefficient
float d, // diffuse coefficient
float s, // specular coefficient
float n, // phong shineiness
float r, // reflectance
float t, // transmission
float index // index of refraction
) {
ir = rval; ig = gval; ib = bval;
ka = a; kd = d; ks = s; ns = n;
kr = r*I255; kt = t; nt = index;
}
|