|
|
How to Make a Multi-View VRML
|
|
|
This document describes how to convert your existing VRML worlds to work with the Multi-Screen VRML program in Java on the Onyx2 Portal.
mkdir mymulti
cd mymulti
where mymulti is the name of your new directory.
cp /software/apps/multi_screen_vrml/bin/* .
cp /software/apps/multi_screen_vrml/templates/* .
cp /software/apps/multi_screen_vrml/src/* .
Now your directory will contain the following files:
ButtonBar.class
java.html
minmax.pl
three.class
three.html
three.java
vrml1.html
vrml1ToVrml2
vrml_header.wrl
At the shell prompt, enter: vrml1ToVrml2 V1file.wrl > V2file.wrl
where:
If an error occurs, your version 1.0 file may not have the VRML 1.0 header included. In this case, you must add:
#VRML V1.0 ascii
in the first line of each VRML version 1.0 file that you convert.
At the shell prompt, enter: minmax.pl
You will be prompted for the names of your VRML files with a message like this:
Please enter the filename(s) of the VRML file (separated by spaces):
Along with the output of the minimums and maximums is the possible size. You will use these values in the Java template in the next step.
There are several template files that need to be modified, in addition
to your VRML files, for the multi-view program to work:
java.html
vrml1.html
three.html
All replacements are marked in the template files by the phrase
"template.variable" where variable is the name of some identifier like size. For
example,
replace: <PARAM name="size" value="template.size">
with: <PARAM name="size" value="50">
There are 9 values that you can or must change in order to make the program work.
The first of these is the size (template.size). This specifies the size of the VRML worlds on average. By looking at the minimum and maximum values produced by the minmax.pl program, derive a size which fairly approximates the average of all axises. You can change this value if you see that the program is panning, scaling, or zooming in too small or too big steps.
Next is the window number (template.windowsize) which specifies the number of VRML worlds you will have on the page. This is usually set to 2 or 3 and this depends on how many worlds you want to see at one time.
Button number is set at 8 but can be changed. This specifies how many buttons are
present for each transformation.
<PARAM name="buttonnumber" value="8">
If you feel that you are not moving in small enough increments (in translating and
rotating), you can increase this number. This also means you must increase the width of
the java applet which is set at 1250 in this file.
<applet code="three.class" mayscript height="132" width="1250">
The other fill-ins are the values of the minimums and maximums that you found through
minmax.pl. Simply plug in the values in the correct template location.
<PARAM name="minx" value="template.minx">
<PARAM name="miny" value="template.miny">
<PARAM name="minz" value="template.minz">
<PARAM name="maxx" value="template.maxx">
<PARAM name="maxy" value="template.maxy">
<PARAM name="maxz" value="template.maxz">
Depending on how many worlds you have, there must be that many files of the format vrml#.html.
Create the files by copying this template. For instance, if you have three worlds,
cp vrml1.html vrml2.html
cp vrml1.html vrml3.html
Within each vrml#.html file, you must change the value of the placeholder "template.vrml"
to one of the the filenames of the VRML file you wish to use. Each one of these files
specifies a particular one of your VRML files.
<embed src="template.vrml" border=10 height="760" width="800">
Depending on how many vrml#.html files you have, you must add or remove the frame lines
which include the vrml#.html files to include the proper number. You must also make
proportional divisions in the frameset to accomodate the number of worlds. Example: 50%,
50% for two worlds; 33%, 33%, 33% for three worlds.
<frameset border=0 cols="33%,33%,33%">
<frame scrolling=no name="vrml1" src="vrml1.html">
<frame scrolling=no name="vrml2" src="vrml2.html">
<frame scrolling=no name="vrml3" src="vrml3.html">
The vrml_header.wrl file contains code which must be included in each of your VRML files. First modify this file as described below, then read this file into the beginning of each of your VRML files right after the "#VRML V2.0 utf8" line.
This is the hardest part of the conversion process. It involves getting your multiple worlds to look good. You will have to make some changes, look at the output, and probably go back and edit each VRML world file to change the values again. Run netscape on three.html to view your application.
A line including the word "Shape" should follow right after the end of the header file you have just included. If it has information between the end of the vrml template (children [), delete the lines as you tally the number of [ and { that do not close off before Shape. Go to the end of the file and delete the number of corresponding ]'s and }'s. Place ]}]}]}]} at the very last line. The application will error if you do not do this or if something was not right in changing the templates. Complete this process to all the worlds you expect to use.
After you have completed making your application, you may remove your copies of the
following files:
minmax.pl
vrml1ToVrml2
vrml_header.wrl
Run netscape on three.html to view your application. See How to Use the Multi-View VRML/Cosmo Java Applet on the Onyx2 for help on how to navigate your multiple worlds.
[footer.htm]