Add 3D To Your Java App With Xj3D And NetBeans IDE

DZone 's Guide to

Add 3D To Your Java App With Xj3D And NetBeans IDE

· Java Zone ·
Free Resource

These are instructions on how to use Xj3D libraries in NetBeans IDE so you can integrate them in your Java application. This tutorial is useful for people that are developing Java applications with Xj3D as a library. If your Java application needs a 3D window that shows X3D or VRML, the best way is to use Xj3D.

  Yes, it's Java, but not the programming language. Photo by JpSlim.

You just need to install Xj3D, the Java SDK, and NetBeans IDE. Ignore any document that tells you to install more things. You don't need to set any system variables. Ignore all that.

Follow these simple steps:

1) Install Java SDK (Java SE) 32 bit. There were some problems with the 64 bit version, so install the 32 bit version.

2) Install Xj3D.

3) Install NetBeans IDE.

4) Create a NetBeans project: Java Application.

If you just want to run the Xj3D examples, specify "with existing sources", and use the folder examples/sai as sources.

5) In the menus, select: Tools -> Library Manager -> New Library. Call it "Xj3Djars" for example, or whatever you like. Click OK.

6) Select the library that you have just created and add everything in the "jars" folder of Xj3D.

In Windows, it used to be in C:\Program Files\Xj3D\jars

In Ubuntu Linux, look into: usr/local/Xj3D/jars (it may be in other folder, but for me it was there)

7) Right click on the project -> Properties -> Libraries -> add Library -> Xj3Djars -> add Library

8) In the Project Properties window, select Run -> VM Options

9) In VM Options type this:

If you use Windows XP:

-Xmx450M -Djava.library.path='C:\Program Files\Xj3D\bin'

In Ubuntu (I prefer Fluxbuntu) Linux:

-Xmx450M -Djava.library.path='usr/local/Xj3D/bin'

10) Click OK.

That's all!

Working With NetBeans IDE And X3D Or VRML

Now that you are working with your application that uses X3D or VRML, you will work faster and better if you could read easily and create X3D and VRML files from inside NetBeans IDE.

I had the same problem, so I created the free X3DV Module Suite.

The X3DV Module Suite is a free set of modules to code in X3D and VRML, the open standards for interactive and immersive 3D on Internet. With it, you can create virtual worlds in 3D, using the great edition features of NetBeans IDE.

This Module Suite is for coding in VRML and X3DV (X3D classical VRML encoding, the easy to read .x3dv files).

Just have a look at its section. The advantages of using it are obvious. It is also compatible with X3D-Edit, as it's shown in their website. You can use X3D-Edit for X3D files in xml format, and the X3DV Module Suite for X3D files in classical VRML encoding, and for VRML files.

If you like the X3DV Module Suite, you can help its development by making a donation. If you can't, another way of helping is voting it in any social bookmarking site, or simply voting it in the NetBeans Plugin Directory.

 Jordi R. Cardona
X3DV Module Suite developer.
NetBeans Community Partner.
Hiperia3D News administrator.

© 2008 by Jordi R. Cardona. The images and text of this post were added by the author to dzone. The author has granted dzone.com with exclusivity to use these images and text for the only purpose to spread this article. If you want to promote this tutorial, you can link to the original one at: http://news.hiperia3d.com/2008/08/how-to-use-xj3d-library-in-netbeans-ide.html




Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}