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

Select one of the choices under "Yellowish Lens" to add a second 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.

There can be up to two lenses in the scene, one of each type. The shape of the lens is defined by the choice menu under the label describing the lens. A new lens replaces the old one of that type.

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.

To add new a new polygon, click on 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 create the outline of the polygon. Use the "Add Polygon" button to close and complete the polygon. Any sequence of points is a valid polygon. To exit input mode without creating anything, click on "Input Points" again.

The "Reset Scene" will recreate the original scene.

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

NOTE: As of July 12, 1996, different versions of Netscape exhibit different repaint problems displaying the choice menus that define the lens shapes after pressing "Clear" or "Reset." Just click in the blank space where the lens shape used to be--it's really still there.


Comments, suggestions, bug reports to stone@parc.xerox.com
This page updated May 1996