How to use Wonderland modules from VRML/X3D files
=================================================

A recent version of java/javac (java SDK, not OpenSDK) should be installed

you need to download the sources of Wonderland (e.g. to src)
ant must be installed

To create a VRML/X3DV file, you can use a 3D modeller like wings3d.
In Wings3D create/modify 3D objects and use File -> Export -> VRML 2.0, 
eg. sample123.wrl

You can use the white_dune program to graphically open and modify 
the VRML/X3DV file. 

To create a wonderland module, open a commandline window

If you want to use X3DB (binary) or X3D (XML) files, you need a translator 
to the X3DV format, like the "aopt" program shipped with the gratis 
"instant reality player" program.

Use something like the commandline

 dune -wonderland src/0.5-preview2/wonderland/modules sample123.wrl

The source for a wonderland module will be created as

   src/0.5-preview2/wonderland/modules/exportX3dv/sample123

Open a commandline window and change in the directory

   src/0.5-preview2/wonderland/modules/exportX3dv/sample123

then run ant

   ant

to create the jar file

   src/0.5-preview2/wonderland/modules/exportX3dv/sample123/dist/sample123.jar

When compiling with  the  command  ant, the java compiler may get out of memory
resources.
To fix the problem, you can set the memory limits  by  extending the 
javac tag in the file  wonderland/build-tools/build-scripts/build-setup.xml e.g.

<javac ...
       ...
       fork="true"
       memoryinitialsize="256m"
       memorymaximumsize="1024m"
>

Start the Wonderland server with

   java -jar path_to/Wonderland.jar

After initialisation, it will show the adress of the started webserver, 
something like http://computername:8080/
If needed, change your firewall settings to allow http://computername:8080/ 
and java web start

Open the http://computername:8080/ URL with Firefox, Internet Explorer etc.

Click to the big button "Server Admin"

Click to "Manage Modules", scroll to the bottom of the page and use 
browse/install to install the module file

   src/0.5-preview2/wonderland/modules/exportX3dv/sample123/dist/sample123.jar

Click to "Manage Server", click to "Restart all" and wait till the servers has been restarted

Then click to "Home" and "Launch"

Click to "login" in the resulting Wonderland client window and use insert -> components to install the sample123
module.

Each run of the "white_dune.exe -wonderland ..." commandline will only modify the file

   src/0.5-preview2/wonderland/modules/exportX3dv/sample12/src/classes/org/jdesktop/wonderland/modules/sample123/client/jme/cellrenderer/Sample123.java 

which contain only the data/numbers from the VRML/X3DV. Program parts to use 
this data with jME/Wonderland like

   src/0.5-preview2/wonderland/modules/exportX3dv/sample12/src/classes/org/jdesktop/wonderland/modules/sample123/client/jme/cellrenderer/Sample123CellRenderer.java 

is not modified. The other programs parts come mainly from the sample tuturials 
and can be changed without the fear to be modified by a new export of the 
3D data. 
