Assignment:
Make a program that has an environment map that produces this
image:
BUG NOTE: the normals in the bunny and plane files ARE flipped!
The files for the above image are the same bunny as for the last program,
and
environment.urs. Note that antialiasing is optional.
Gamma correction should make the colors look like the image above.
Important: there is a new color filed in the URS Material definition.
Material kd_r kd_g kd_b ke_r ke_g ke_b ks_r ks_g ks_b exp
Specifies the components of a Phong material model, Kd, Ks and the exponent.
Here ke is the color you multiply the environment map contribution by. Use this formula for the environment map as
a function of direction:
rgb background( const Vector3& v) const {
if (v.y() > 0) {
double t = v.y();
t *=t;
return t*rgb(0.1,0.2,0.5) + (1-t)*rgb(1,1,1);
}
else
return rgb(0, 0, 0);
}
My Answer:

With Java, this took 1 minute and 14 seconds for I/O and rasterization on a Celeron 500MHZ with 256MB of RAM.