This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

'Bubble Lens' demo effect

One of the most famous demos that has a lens effect is 2nd reality by future crew.
The trick is to precalculate the entire effect. Just make an array that for each pixel in the
destination picture tells which pixel to take from the source picture. This array is called the
transformation array. The tricky part is to calculate the transformation array to make the destination
look like a lens is beeing held over the source picture. Based on lens formula by on Abe Racadabra

Transparent soap overlay
http://luis.net/projects/processing/bubble/data/bubble.png

Background (640 x 480)
http://luis.net/projects/processing/bubble/data/coke.png

Source code: bubble

Built with Processing