Home| Howto's| Downloads - RPM's| Developers & Admins| Resources| About Us
GENERAL LINKS
N E W S
L i n k s
K n o w l e d g e
    B a s e

F o r u m s
T e a m
  BE SURE TO FOLLOW OUR DAILY NEWS SITE

Project Looking Glass-dev-cvs Howto


Project Looking Glass is based on Java technology bringing 3D windowing and visualization to your JDS system.

Currently the proof of concept LG3D-CORE demo is available for download at https://lg3d-core.dev.java.net/. But this page will explains how to prepare and install lg3d-core on to your JDS using cvs.

Before beginning the process of setting up your LG3D environment, you need to first check to make sure that your system meets the necessary requirements:

Operating System = "Sun Java Desktop System Release 1 or 2".

As this tutorial is based on SJD no other Linux flavour will be mentioned.

CPU = "2 GHZ or faster"

It is recommended by Sun Microsystems that you have a fast processor; I am personally using a 2.3GHZ SMP.

RAM= "512 or more"

Graphics Card "3D accelerated graphics card with supported drivers for OpenGL, version 1.2 or greater.

If intending to use LG3D with full screen resolution a 24-bit display depth is required!

So now we have that information out of the way lets start by collecting some information on your system just to make sure we cover the minimum system requirement.

# Step One:

Open a Terminal session within you SJD Graphical interface.

. Launch Applications System Tools Terminal

The next couple of steps are simple commands executed in the new Terminal Window that you have just opened.

# Step Two:

As the Project Looking Glass requires a colour depth of at least 24 bits and many systems are configured by default with 16 bit colour depths the Project Looking Glass will not run correctly as it is supposed to. So for you to be able to identify your current display depth there are many ways to do it but the two most popular methods used by myself are mentioned here:

Command: # cat /etc/X11/XF86Config | grep DefaultDepth

By executing this command you are using the standard Unix - Linux "cat" command to display the content of the XF86Config config file, followed by a pipe sign and the simple "grep" command. By using the "grep" command you are gripping the only information that you are interested at this point in time and discarding all the other information.

Now assuming your screen depth is set to the minimum depth of 24 this is the result you should expect to see from the above command:

DefaultDepth 24

Now the second option to display your current screen depth is a simple command that you can run to view the same information as the one above:

Command: # xdpyinfo | grep "depth of "

Once again assuming your screen depth is set to the minimum depth required this is the result you should see from the above command:


depth of root window: 24 planes


Once you have run the above commands and you are satisfied that you meet the necessary requirement go directly to step four omitting step three. Or if the result does not meet the requirements i.e. display "DefaultDepth = 24" or "depth of root window: = 24 planes" then continue with step three.

# Step Three:

From within a terminal session you have earlier open, run the sax2 command:

Command: # /usr/X11R6/bin/sax2
SaX: root Password: "enter root password" if you are not yet logged in as root.

Once the SaX2 application has opened:

Colour and Resolution Properties

In the "colour selection panel", click on the menu and choose "16.7 Mio. [24 Bit]".

Following that on the "Resolution(s) for 16.7 Mio. [24 Bit] colours" tab, select the preferred resolution for your desktop.

For example the maximum resolution available to my monitor is 1280x1024 so I have selected the following options:

[x]1280 x 1024

[ ]1280 x 960

[x]1024 x 768

[x] 800 x 600

[x] 640 x 480

Once you have made your choice press "OK" followed by the Finish button.

Now you should be back to your original sax2 window and to complete the configuration select "Finalize …"

When you click on Finalize, a new window will pop up and it is recommended that you do run the test to make sure that the new setting will work correctly.







A blue test screen should appear, adjust it as required so that you screen is nicely laid out in the middle of your monitor once you are satisfied click the "Save" button on the display and then "Ok" when you return to the SaX2 window, followed by "Yes" to exit from SaX2



If the test screen did not appear correctly, leave the system IDEL for 30 seconds, the test will exit after that period and your previous desktop session will be restored. At this point you should then try alternate resolutions at the 24-bit colour depth to find a resolution that works for your monitor.



When you are satisfied with the settings and your test goes correctly log out and re-login to your desktop session and verify that the colour depth is now 24-bit or higher by using the same commands provided at the beginning of this step.





# Step Four:

Step four is quite simple all you really doing is downloading the necessary components that is required for the LG3D Project on to your existing Java Desktop System.

The installation instructions assume that you download all of the components into ~/projects/java, so before you start downloading execute the following command:

Command: # mkdir ~/projects/java



Now you should be ready to start downloading, so lets go:

  • First Download

Java 2 SDK, Standard Edition 1.5.0 Beta 2 or later

http://www.jdshelp.com/incoming/LG3D/jdk-1_5_0-beta2-linux-i586-rpm.bin



  • Second Download

Java 3D SDK 1.3.2-build4

http://www.jdshelp.com/incoming/LG3D/java3d-1_3_2-build4-linux-i586.tar.gz



  • Third Download

Java Advanced Imaging API (JAI) 1.1.2 JDK

http://www.jdshelp.com/incoming/LG3D/jai-1_1_2-lib-linux-i586-jdk.bin



  • Fourth Download

Apache Ant 1.6.2 Compiler

http://apache.mirror.positive-internet.com/ant/source/apache-ant-1.6.2-src.tar.gz

# Step Five:

Now that you have all the necessary components to install and configure lg3d-core cvs it is a good time to begin the installation, first of all if you have closed the terminal session you had opened before open a new one and log in as root.

Command: # su - root
Password: enter root password

For our first step in the installation process you are going to install the Java 2 SDK.

NB. I am assuming that you have download all of the components into /tmp/lg3d

Command: # cd ~/projects/java

This will simply take you to the directory where all your files have been downloaded to.

Command: # sh jdk-1_5_0-beta2-linux-i586-rpm.bin

The above command is now extracting the rpm file and installing it onto your system.

Well you are now getting closer to seeing your lg3d working on your system. Now you need to install the Java 3D SDK: If you are not already in the directory that contains all your source files for LG3D run the first command otherwise just start at the next step.

Command: # tar -zxf java3d-1_3_2-build4-linux-i586.tar.gz

The above command is using the tar archiving tool to extract the java3d-1_3_2-build4-linux-i586.tar.gz file.


Command: # cd /usr/java/jdk1.5.0/jre

Now you are entering the directory where all your java files live, this directory was actually created when you installed your jdk01_5_0.


Command: # /usr/java/jdk1.5.0/bin/jar xvf ~/projects/java/java3d-1_3_2-build4-linux-i586/j3d-132-build4-linux-x86.jar

The above command looks complicated but it is actually quite simple, you have first entered the directory where you wish to extract the java3d jar file and then all you did was actually extract the jar file from your source directory /tmp/lg3d

At this point there is only one extra Java installation needed before you can actually install the Project Looking Glass files. So now you will install a Java API and the API you are going to install is the Advanced Imaging API for Java. For those wondering what a API is – it is a (Application Program Interface)


Command: # cd /usr/java/jdk1.5.0

Return to your java installation directory where you are going to run the next command:


Command: # sh ~/projects/java/jai-1_1_2-lib-linux-i586-jdk.bin

The above command is extract the lg3d/jai-1_1_2-lib-linux-i586-jdk.bin file into the current directory.

Now all your java is installed and before you go any further you can delete some unwanted files.

To Install Apache ANT:

# cd /usr/local
# tar -xzf ~/projects/java/apache-ant-1.6.1-bin.tar.gz

# Step Six:

Ok the installation of the Java software is now done, but just before you continue, you need to set some variables to your environment. I am assuming that you do not normally run as root but a normal user so your first step will be:

Exit from the shell as root so that you once again become your normal user:

Command: # exit

Several environment variables now need to be set in your shell profile. Here are examples appropriate for bash / sh or ksh shell:

If you are running on the default bash shell you need to run the following command:


Command: # echo "JAVA_HOME=/usr/java/jdk1.5.0; export JAVA_HOME" >> ~/.bash_profile
Command: # echo "PATH=$JAVA_HOME/bin:$PATH; export PATH" >> ~/.bash_profile

Command: # echo "ANT_HOME=/usr/local/apache-ant-1.6.1; export PATH" >> ~/.bash_profile
Command: # echo "PATH=$ANT_HOME/bin:$PATH; export PATH" >> ~/.bash_profile



If you are running on the sh & ksh shell you need to run the following command:


Command: # echo "JAVA_HOME=/usr/java/jdk1.5.0; export JAVA_HOME" >> ~/.profile
Command: # echo "PATH=$JAVA_HOME/bin:$PATH; export PATH" >> ~/.profile

Command: # echo "ANT_HOME=/usr/local/apache-ant-1.6.1; export PATH" >> ~/.profile
Command: # echo "PATH=$ANT_HOME/bin:$PATH; export PATH" >> ~/.profile



Now to set the same variable for the root user:

Command: # su - root

Repeat the above steps so that you will also have the root user's environment setup. Once all the environment has been setup execute the following command:

Command:# cd ~

Command:# . ./.profile or

Command:# . ./.bash_profile



# Step Seven:

To download the Project Looking Glass source code you must first request access to the lg3d project:

  1. Navigate to https://lg3d.dev.java.net and bookmark it for future reference. You'll be coming back often!

  2. Click on the Request project membership/role link.

  3. Select the appropriate role:
    - Select Observer if you just want to build Project Looking Glass.
    - Select Developer if you plan to develop new code for Project Looking Glass and want the option to contribute code to the project.

  4. After submitting your request, you will receive an e-mail that contains instructions on how to access the project.

From now on, when you go to the lg3d project web site you'll be prompted for your username and password and will be redirected to the main project page.

To browse the Project Looking Glass core source code, click on lg3d-core in the Subprojects section of the
lg3d project web site Then click on Version control in the Project  tools section of the side bar. On the right side you'll see the source tree represented as links. You can click on these links to browse the source tree and download individual files for viewing.

# Step Eight

Now it is the time you have been waiting for as it is time to Install the "Project Looking Glass Developer's Release"

$USER = <User account Just created at Sun Microsystem's web site>

Command:# mkdir -p ~/projects/lg3d/lg3d-core

Command:# cd ~/projects/lg3d
Command:# cvs -d :pserver:$USER@cvs.dev.java.net:/cvs login
Command:# cvs -d :pserver:$USER@cvs.dev.java.net:/cvs checkout lg3d-core
Command:# cvs -d :pserver:$USER@cvs.dev.java.net:/cvs checkout lg3d-demo-apps
Command:# cd ~/projects/lg3d/lg3d-core
Command:# ant

While ant is compiling the new code you should seem something like this:

Buildfile: build.xml

init:
[mkdir] Created dir: /home/username/projects/lg3d/lg3d-core/build/classes

unpack-x:
[untar] Expanding: /home/username/projects/lg3d/lg3d-core/ext/lg3d-x11.tar.gz into /home/username/projects/lg3d/lg3d-core/ext

compile:
[javac] Compiling 1 source file to /home/username/projects/lg3d/lg3d-core/build-tools
[javac] Compiling 626 source files to /home/username/projects/lg3d/lg3d-core/build/classes

compile-x11:

check-escher:
[javac] Compiling 25 source files to /home/username/projects/lg3d/lg3d-core/build/classes


init:


unpack-x:

native-x11:
[exec] .:/home/username/projects/lg3d/lg3d-core/src/../build/classes

junit-tests:

no-junit-tests:
[echo] Skipping junit tests because junit.jar is not installed in ext-unbundeled

compile-demo-apps:
[javac] Compiling 5 source files to /home/username/projects/lg3d/lg3d-core/build/classes
[copy] Copying 4 files to /home/username/projects/lg3d/lg3d-core/build/classes/org/jdesktop/lg3d/apps/cdviewer/resources
[copy] Copying 1 file to /home/username/projects/lg3d/lg3d-core/build/classes/org/jdesktop/lg3d/apps/tutorial/resources
[copy] Copying 1 file to /home/username/projects/lg3d/lg3d-core/build/classes/org/jdesktop/lg3d/apps/help/resources

jar:
[mkdir] Created dir: /home/username/projects/lg3d/lg3d-core/build/lib
[jar] Building jar: /home/username/projects/lg3d/lg3d-core/build/lib/lg3d-core.jar

all:

BUILD SUCCESSFUL
Total time: 32 seconds

# Step Nine

Once the installation has completed there should be some updates so to download the updates run the following command:

Command:# cd ~/projects/lg3d/lg3d-core
Command:# ant clean
Command:# cd ~/projects/lg3d/
Command:# cvs -d :pserver:$USER@cvs.dev.java.net:/cvs update -Pd lg3d-core
Command:# cvs -d :pserver:$USER@cvs.dev.java.net:/cvs update -Pd lg3d-demo-apps
Command:# cd ~/projects/lg3d/lg3d-core
Command:# ant



# Step Ten

In my point of view this is the most exiting step through the whole process as you are about to Run "Project Looking Glass"

There are two ways to run Project Looking Glass (i) in a window within an existing desktop environment or (ii) as a full-screen desktop.

Remember that only the full-screen desktop mode supports a key Project Looking Glass feature, the integration of native, unmodified X11 applications.

The easiest way to verify that your Project Looking Glass installation is correct is to run the demo within an existing desktop. Once you are satisfied it is working correctly, you can then configure your system to run Project Looking Glass full-screen.

Note that running Project Looking Glass in a desktop window is a good way to develop and test 3D applications and enhancements to the Window Manager (Scene Manager).

Running Project Looking Glass within an existing desktop environment

In this mode, a Project Looking Glass session runs in a window in your desktop. This is the simplest way to run Project Looking Glass but this mode only allows you to run Project Looking Glass 3D applications, such as the CD chooser. X11 applications, such as xterm will appear in the X session that you launched the Project Looking Glass session from.

Log into your account and change directory to where you installed Project Looking Glass:

Command: # cd ~/projects/lg3d/lg3d-core/src/devscripts

Now start the Project Looking Glass session:

Command: # sh lg3d-dev

If you have successfully installed Project Looking Glass you should see the familiar Project Looking Glass desktop in a window on your desktop:

Running Project Looking Glass full-screen

This mode allows you to run Project Looking Glass in full-screen and gives you the ability to launch other application, including native X11 applications. To do this you must first shutdown your X session before starting Project Looking Glass.

To run Project Looking Glass you must first shut down xdm. Since this process is respawned automatically if you kill it you must first disable this service using the chkconfig command:

Once again launch a terminal session and log in as root:

Command: # su - root
Password: enter root password

Now to disable the xdm from respawnning automatically every time you kill it, run the following command:


Command: # /sbin/chkconfig -d xdm

xdm  0:off   1:off   2:off   3:off   4:off   5:off   6:off

Now close any desktop applications and save any open files. Then shutdown the display manager:
From the same terminal session run the following commands:


Command: # pkill gdm-binary

and if that does not work:

Command: # pkill X

Starting the Project Looking Glass desktop session

To start a Project Looking Glass desktop session from the console not within an X session, login as your self enter in your password, become root and change directory to where you installed Project Looking Glass:

Command: # cd ~/projects/lg3d/lg3d-core/src/devscripts

With the above command you are changing to the directory where Project looking glass was installed.

Command: #su - root assuming you installed it as root.

Now it time to start the Project Looking Glass desktop session

Command: # sh lg3d-session


If all steps of the way went successful, after a few seconds the Project Looking Glass desktop should appear.

#### Congratulations! ####

To re-activate the X Display manager so that you can launch your Default Graphical interface, enter the following command as root, and then reboot your system:

Command: # /sbin/chkconfig -a xdm

### END OF TUTORIAL ###

If you have problems starting the desktop session, refer to the Troubleshooting section for assistance.

Or explore the unofficial Project Looking Glass forum at http://www.gcclinux.com and ask as many question as required, we will do our best to get lg3d working for you.

Created on the 30th Augusto, 2004 by Ricardo Wagemaker with first hand experience.