Top Linux Links You Must Click On


Java Feature — Graph3D
Visualizing data using Java3D

Installing Java3D
To run Graph3D, you'll have to have Java3D installed on your computer. Java3D can be downloaded at java.sun.com/products/java-media/3D/downloads. If your computer is a PC, you may have to install OpenGL or DirectX. Most PCs automatically come with OpenGL or DirectX installed, but if yours doesn't, see www.microsoft.com/downloads. To run Java3D on Unix workstations see the workstation maker Web site for Java3D support.

Running Graph3D
To compile the Graph3D application, type the following command in a DOS window from the directory containing the source code:

javac -classpath .; *.java

To run Graph3D as a standalone application in a DOS window, type the following command from the source code directory:

java -classpath .; Standalone

As with computer games, the quality of the Java3D display depends heavily on the quality of the graphics board installed in the computer. Low-end boards tend to leave out parts of the display like lines, surfaces, and text.

Running from a Browser
Java3D can be run from both Netscape and Microsoft Internet Explorer (IE) web browsers. When installing the latest version of the Java JDK, the install process automatically points your web browser to the developer's kit. As long as you installed Java3D to this version of the JDK, all the work is done for you. To verify which version of the JDK your browser will use, go to the "Control Panel" on your PC and click on the Java menu.

To run Graph3D from one of these browsers, open the file AppletGraph3D.html (included in the source code) from your browser. Since Graph3D is expecting input from a data file on your local PC, you'll have to grant "read" file permission to the file plot3D.dat in the java.policy file. This is located in the "jdk_install_directory/jre/lib/security" directory. The syntax for granting permissions is:

grant codeBase "file:/C:/source_code " {
permission java.io.FilePermission "C:/source_code/plot3D.dat",read";
};

Granting permissions this way lets any applet running in the browser access your local file. So do this for demonstration purposes only. Realistically, a browser running the Graph3D applet won't use data from a file on the local computer. The user must change Graph3D appropriately to get the data from the server and format it.

Please view the Author's Source code

Summary
There are many fine commercial off-the-shelf (COTS) graphing packages available. While they may currently solve your particular graphing needs, writing your own graphing software gives you total control and lets you change it in any fashion desired. This will be beneficial in the long run since it will be totally portable and there will be no need for licenses, upgrades, or maintenance fees. Besides, the vendor may not incorporate any bug fixes or desired features not currently in a COTS package any time soon. Graph3D provides the core classes and technology for Java3D programming and can be used as a starting point for developing your own graphing application. As you've seen, Graph3D isn't a complex application and hopefully you'll consider using Java3D in your current or future projects.

About Valor Dodd
Valor Dodd is a Java-certified senior software engineer at Lockheed Martin in Denver, Colorado. He has more than 20 years of software experience developing computer graphics and GUI applications for the telephone and defense industries.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Same comment. I am beginning work on similar classes. Was excited to read that it was done and the article stated that this is how you complile the source code and then no source code. An email with the source code link would be great!

At the risk of being repetitious, I too would like to find the source code for Graph3D.

The section "Running Graph3D" implies that the source code is available but I cannot find it.

Hi there,

Sorry for repeating the question but, is the Graph3D source available for download???

I was a little disappointed with the article. I thought it was going to show me how to do cool things with Java3D, not just talk about what the author had done for himself! Especially since it doesn't appear that the code discussed in the article is available. I usually expect more from JDJ.
(*Chris*)

Hi - where might one download the Graph3D application you're mentioning?

thanks!

jeff


  Subscribe to our RSS feeds now and receive the next article instantly!
In It? Reprint It! Contact advertising(at)sys-con.com to order your reprints!
ADS BY GOOGLE
Subscribe to the World's Most Powerful Newsletters