Mandrill

Mirror, Mirror

Texture mapping, reflecting, refracting

A texture is an image, in this case an image of a mandrill, and it is mapped to point coordinates in WebGL.

Reflection of the texture onto the sphere requires an environment map, which maps texture coordinates to a world coordinate after multiplying scaling, rotation, and translation matrices and then checks if the ray from the sphere hits the texture or not.

Refraction takes advantage of Snell's law to make a diamond where the velocity of light is 2.4 times slower than in air.

zoom 1x 10x

Oops ... your browser doesn't support the HTML5 canvas element