Magic Lens Demo

Copyright 1996 Xerox Corporation. All Rights Reserved.
Magic Lens is a trademark of the Xerox Corporation. Legal Notices

Below is a Java applet that demonstrates a simple example of the Magic Lens technology developed at Xerox PARC. The current scene consists of three polygons and a square Magic Lens that darkens and saturates the polygon colors. Move the lens by dragging it with the left mouse button.

NOTE: Colormap problems can ruin the effect of this demo. In the X world, I've found running Netscape 2.0 with either no flags or the -no-install flag gives the best results. Due to a bug in Netscape 2.0, using the -install flag gives terrible results.

Adding a Second Lens

To add a lens that makes the polygon colors "yellowish" click the "Input Points" button or click anywhere in the gray background inside the thin, white border. The border will change to blue to indicate "input mode," and a small blue dot will appear at the point clicked. Add several points to construct the outline of a convex polygon (for example, a triangle). Click on "Yellowish Lens" to create the lens. This new lens can be moved like the square one.

When the lenses overlap, their operations compose. That is, the colors become both darker and yellowish. The moving lens will be "on top" of the other scene objects. Changing the overlap order changes the effect of composing the lenses. Depending on your color display, this may be a subtle effect.

Changing the Scene

Move or rotate the polygons by dragging them with the mouse. Polygons rotate if grabbed near the vertices, translate if they are grabbed near the center. Lenses do not rotate.

Add new polygons to the scene by first inputting points, then clicking on the "Polygon" button. Any sequence of points is a valid polygon.

Change the shape of the lenses by first inputting points, then clicking on one of the "Lens" buttons. To work properly, the lenses must be convex polygons. That is, they cannot have any indentations in their outline.

The "Clear" button will delete all of the polygons and lenses, leaving a blank canvas to play with.