Touring Sun's 3D desktop

Looking Glass


The Looking Glass 3D desktop environment offers an exotic new view of your workspace.

By Fabrizio Ciacchi

marilyna, Fotolia

The 3D graphic desktop is a popular topic in the Linux community. Tools such as Compiz [1] and Beryl [2] (on XGL or AIGLX) provide some interesting 3D effects, but these tools have only begun to explore the possibilities of using the third dimension to display and organize information.

One of the first - and one of the most sophisticated - projects dedicated to unlocking the potential of the 3D environment is Looking Glass [3]. The Looking Glass project (LG3D) was created by a Sun programmer, Hideya Kawahara, who began writing it in his spare time on a Linux laptop. Hideya showed the project to his superiors at Sun, and they assigned a team of developers to help him create this new 3D world. Looking Glass is built on top of Java 3D technology and includes some special LG3D libraries for generating 3D effects.

Sun recently released Looking Glass 1.0, the first stable release of Looking Glass 3D. This landmark release includes critical bug fixes, as well as new features to make Looking Glass easier to install and use. This article shows you how to get started with Looking Glass and introduces some important features of the innovative Looking Glass desktop.

Installing Looking Glass

Looking Glass can run on Linux, Windows, and Solaris. If you just want to take the Looking Glass environment for a test drive, you might want to try the Looking Glass Live CD, which is available on the Internet [4]. (See the box titled "The Looking Glass Live CD.")

To install Looking Glass on Linux, you'll need the following:

Of course, these requirements are only the minimum. You may need more horsepower for acceptable performance. An ATI or NVIDIA graphics card with at least 256MB of memory is recommended. Looking Glass also requires full OpenGL support. For more on configuring your Linux system for Looking Glass, see the box titled "Configuring X."

You can obtain Looking Glass from the binary builds page of the Looking Glass website [5]. Select the Linux x86 Mega Bundle - a single file with easy installation for non-experts. The file is about 150MB. Once you have finished the download, you will have a file called something like lg3d--1-0-0-linux-i686-0612190943.bin. With the following command, extract the .bin file:

$ sh lg3d--1-0-0-linux-i686-0612190943.bin

The installer displays a license agreement. Read it by pressing the spacebar, then type yes to make the installer decompress the program into an lg3d subdirectory. Move the program to the /opt directory:

# mv lg3d /opt
# cd /opt
# chown user:user lg3d -R

At this point, you can start Looking Glass three ways. You can (1) execute the program in a window with the command lg3d-app, (2) start Looking Glass in full-screen mode with lg3d-app-full, or (3) if you want to add Looking Glass to GDM sessions, give the following commands at the console as root:

# ln -s /opt/lg3d /usr/share/
# cd /usr/share/lg3d/bin
# ./postinstall

Looking Around

At the bottom of the Looking Glass display is the taskbar (Figure 1).On the left side is the Looking Glass menu, which offers access to applications installed on the system. Beside the menu are icons for frequently used tools, followed by icons for other open applications. On the far right is the jolly roger flag, which you can use to exit Looking Glass.

Figure 1: The taskbar is at the center of the Looking Glass environment.

So far this might seem like an ordinary desktop, but if you start to look a little closer, you'll see that Looking Glass is anything but ordinary.

One thing to notice is that Looking Glass supports a panoramic background. Multiple desktop views can inhabit regions of a single panoramic image (Figure 2 - the arrows denote the dimensions of a single view). By left-clicking on the left or right side of the area, the user can pass from one piece of the panoramic image to the adjacent view, and with a right-click on the taskbar, the user can view the entire image to choose a workspace (as shown in Figure 2).

Figure 2: Choose a workspace by moving among the regions of a single panorama.

Another interesting feature of Looking Glass is the use of perspective. Not only do single objects have depth, but the workspace itself appears to have depth. Looking Glass adds a z-axis to the user experience (Figure 3). Objects that are farther away appear smaller, and objects that are closer appear larger. A window is initially opened at a default "distance" along the z dimension. You can then position the pointer on the titlebar, press Ctrl, and use the mouse scrollbar to move the window in or out. This feature lets you zoom in on the window you're currently working with and zoom out on windows you won't need for a while.

Figure 3: Objects appear smaller or larger depending on their position in the three-dimensional workspace.

But this is only the beginning of the tricks you can play with Looking Glass windows. Another interesting function (and perhaps more innovative) is the ability to write notes on the back side of a window (Figure 4). You can use this feature to record an observation on the contents of the window or add a reminder of some future action. To make a note on a window, right-click on the titlebar, and the window rotates 180º. On the back, you'll find a note space in which you can write some simple text. Right-click again on the titlebar to return the window to its original side.

Figure 4: Looking Glass lets you write notes on the back of a window.

Looking Glass can even use the edge of the window. You can rotate a window so that the title appears on the spine of the window itself. This lets you arrange the windows for convenient reference like books in a library (Figure 5). As you explore the Looking Glass desktop environment, you'll find other interesting features. For instance, the taskbar icon for an open program is not simply a standard static image but is actually a small copy of the window itself. (If a movie is playing in the window, it plays also in the taskbar.)

Figure 5: You can line up Looking Glass windows like books on a shelf.

The Java logo in the upper right corner lets you rotate the entire desktop environment. When several windows are open, you might find that a different angle will give you a better vantage point for viewing the desktop. Left-click on the Java logo and and hold down the button to change to a different angle. (Perhaps it is not the most useful function, but it really is fun.)

The Looking Glass Live CD

One easy way to try out Looking Glass is with the Looking Glass Live CD. The Live CD, which runs from the CD drive and will not tamper with your current installation, comes with a pre-installed version of Looking Glass. You can download the 264MB ISO from the Looking Glass Live CD homepage [4].

The Live CD is based on the SLAX distribution [6]. After you download the ISO, record the image to disk with a tool such as K3b, then put the CD into the CD drive and reboot your computer. Remember to enter the BIOS, if necessary, and change the boot order to make your system boot from the CD.

Configuring X

For more on installing graphics cards and updating drivers, see the vendor documentation. As for your X configuration, if you have an ATI graphics card [7], after you have installed the correct Linux driver, you need to enable DRI. If you are using the nano editor, you can give the following command as root (with sudo -s or su):

# nano /etc/X11/xorg.conf

Or use XF86Config if applicable.

When the editor opens, make sure the following lines are present:

Section "Module"
        Load "glx"
        Load "dri"
EndSection
Section "DRI"
    Mode 0666
EndSection

Press Ctrl+O to save the file and Ctrl+X to exit.

With an NVIDIA card [8], no further configuration is necessary after you install the driver, but you might need to add the following settings to xorg.conf to make OpenGL work correctly:

Section "Device"
Driver "nvidia"
Identifier "Videocard0"
Option "AllowGLXWithComposite" "true"
EndSection

You'll also need to set up 24-bit color depth in xorg.conf. Listing 1 is a sample configuration of the Screen section.

Listing 1: Sample Configuration
01 Section "Screen"
02 Identifier "Screen0"
03 Device "Videocard0"
04 Monitor "Monitor0"
05 DefaultDepth 24
06 SubSection "Display"
07 Viewport 0 0
08 Depth 24
09 Modes "1024x768" "800x600" "640x480"
10 EndSubSection
11 EndSection

Save the file and reboot your computer (to be sure all the correct settings are applied). From a console window, give the command

$ glxinfo | grep "GLX version"

to see whether GLX is loaded correctly. If you are successful, you will receive a response like GLX version: 1.3. If you don't receive a response, try

$ glxinfo | grep "direct rendering"

to see whether direct rendering is enabled. If direct rendering is not enabled, you need to reinstall the graphics driver or check that all the preceding settings are correctly configured.

Apps in Looking Glass

Looking Glass can run Linux applications and native Java applications. The Java applications use the Java 3D libraries and specialized Looking Glass classes. Any 2D Linux applications are rendered in 3D by an abstraction layer provided for X11 [10]. Looking Glass works well with popular Linux programs such as Mozilla Firefox and Evolution. Previous versions had some issues with certain standard Linux apps because of the specialized Looking Glass libraries, but this problem is very uncommon in version 1.0.

Of course, you'll find the fullest expression of Looking Glass features in applications that are written directly for Looking Glass. Some experimental Looking Glass applications are already available. For instance, Trumplayer is a music player that uses Looking Glass's bookshelf positioning feature to represent each song as a box with the title on the edge (Figure 6).

Figure 6: Trumplayer puts each song in a virtual CD case.

The Zoetrope photo viewer lets you scroll through photos in a carousel format. Looking Glass's LgScope 3D file manager displays files and directories as three-dimensional blocks, with the file details on a face adjacent to the name (Figure 7).

Figure 7: The LgScope file manager displays files and directories as three-dimensional blocks.

Conclusions

Looking Glass is a very impressive and innovative project, but you might find that it isn't quite ready for daily use. Although the system is basically stable, I faced occasional problems with the screen refreshing. (This was probably because of missing fonts or non-native program execution.)

The graphics are very impressive, but sometimes simple renderings, and even some backgrounds, appeared at unexpectedly low resolution. These simplifications perhaps improve performance, but some users could find them frustrating. Despite these issues, Looking Glass is a very important project that presents an interesting new approach to the 3D desktop.

INFO
[1] Compiz homepage: http://www.go-compiz.org
[2] Beryl homepage: http://www.beryl-project.org
[3] Looking Glass homepage: http://www.sun.com/software/looking_glass/
[4] Looking Glass Live CD: https://lg3d-livecd.dev.java.net
[5] Looking Glass binary builds: https://lg3d-core.dev.java.net/binary-builds.html
[6] SLAX: http://www.slax.org
[7] ATI installation tips: https://lg3d.dev.java.net/dri-driver-install-ati-radeon.html
[8] NVIDIA installation tips: https://lg3d.dev.java.net/nvidia-driver-install-tips.html
[9] Looking Glass installation instructions: https://lg3d.dev.java.net/lg3d-getting-started.html
[10] LG3D overview PDF: https://lg3d-core.dev.java.net/files/documents/1834/30923/LG3D-Overview.pdf
[11] 3D-related technologies: http://lg3d-core.dev.java.net/lg3d-related-technologies.html