It's very easy to use the Lake applet to reflect a distant horizon, but what about a more complex image, like the one shown here, with some foreground detail?
Here, for instance, the courtyard does not reflect in the water and the tower on the right hand side projects out over the water. Can Lake be used to animate the water in this scene?
Fortunately Lake (version 2 and above) can - by using the OVERLAY parameter.
The parameter is used to place a static (i.e. non-rippling) image over the top of the
lake scene. This is usually used to place a logo over the top of the scene, but we can use
it more subtly. Here are the steps to create an animated version of this
The height of the applet will have to be slightly less than twice the height of the reflected image. Fortunately the original image is 275 pixels high and when we try the applet with this height we see that it works quite nicely. So far then we have:
Now get the bits that won't reflect
Image with the water cut out
The first and easiest part of this process, is to cut out the part where the water shows
through. You can see this to the left here.
Cut out the top half
But we can do more than this. By cutting out more of the picture we can save some bandwidth, and we know that the most of the top half of the image will already be visible. We can therefore crop out the top 150 rows of pixels.
|Raised by 13 pixels|
We can now compare the two images: