Your browser does not support the applet tag

Pool

A watery applet

wave your mouse
over the eye

This Java applet features dynamic image processing, simple thread handling, and a public interface that can be called by eg. Javascript.
The code dynamically modifies a "height map" to simulate rippling water.
The water effect can be triggered by moving the mouse directly over the pool, or via Javascript calls associated with other HTML elements on the page.

How it works

A thread runs continually behind the scenes. It repeatedly:
  1. calculates the latest peaks & troughs on the height map
  2. paints the applet image, shaded accordingly
During the calculation stage, each point on the height map is influenced by the points immediately surrounding it.
Pool is adapted from some image processing code that I found on the web. Credit and respect is due to the unknown inventor of the water algorithm.