|
|
For the rest of us, there is a W95/NT version. The code can be executed using the shortcut from the CiteMap group, or via the file called VRMLDataTrimmer.exe in the "bin" folder under the CiteMap installation. Double-click this file to execute VDT.
The code will automatically add a prefix of "M_" to the input filename. This can be changed by typing in the Output File field or by using Browse. If the Gzip option is on, the filename will also have a "_gz" added, just before the file extension. To summarize, for the file "myscene.wrl," the default output is either:
M_myscene.wrl -or- M_myscene_gz.wrl
Regardless of the options selected, VDT will remove extra white space. For example, multiple adjacent blank spaces, tabs, and blank lines will be removed. This often has the effect of slamming everything against the left side of the page.
The Round Floating Point option can greatly reduce the size of VRML scenes produced with 3D modellers. If this option is selected, the user can choose how many significant digits to retain. Precision will be preserved, to the specified level. A rounding factor of 3 works well for most files (but always test). For example, a rounding factor of 3 will yield the following:
Original 3 Sig Dig Float Result ---------------------------- 1.23456 1.23 6.54321 6.54 0.56789 0.568 0.00000 0 0.40000 0.4 0.01234 0.0123 0.00987123 0.00987The Remove Comments option will remove VRML comments, i.e., lines starting with "#" or lines ending in "#" followed by some string.
The Remove Ends of Lines option will remove EOL characters. Since comments rely on EOLs as delimiters, it this option is enabled comments will also be removed (the interface enforces this constraint).
The GZIP option simply implements the Gzip functionality available in JDK1.1. Gzipping is the single most important factor in compressing VRML file size, and should always be used for published files (with the exception of small examples whose source is to be viewed). Most browsers seem to understand the file extension of ".wrl" --- even for Gzipped files with this name. Hence, VDT produces a filename of M_something_gz.wrl, which should work verbatim (strip the M_, and/or remove the _gz if you like).
VDT does not do everything that a knowledgeable practitioner might do
as a matter of course. For example, the data for face set normals produced
by 3D modellers is often extraneous, and can be removed.
Other Tools of Interest
Vorlon is a VRML97
checker which can find many problems and inefficiencies. It is also used,
unofficially as of this writing, as the "acid test" for spec-compliant
VRML. Vorlon is Java-based freeware.
vwaif is a tool that is very similar to VDT. It is also freeware, written in C, and has a DOS executable version. It is command line driven and does not include Gzip (as far as we know), but you might like to try both vwaif and VDT to see which does a better job on your scene types.
Chisel is a VRML Optimizer under development at Trapezium (the people who brought us Vorlon). This tool has not been released as of this writing, but it's pre-release description says:
[Chisel] provides VRML authors with a rich set of tools for reducing the size and complexity of their worlds.
Update: Chisel is now available from Trapezium!
Shrinker is another homegrown effort, announced on the www-vrml list. See: The Kahuna's Vrml Tools. Contact the author for further information (kahunas@redshift.com).
On on test file, a quick, non-scientific comparison of VDT, vwaif, and shrinker yielded file sizes of 81, 86, and 99 (3, 3, and, 5 digits were retained, respectively). Since shrinker is being enhanced, according to the author, it is worth keeping an eye on if VDT doesn't give sufficient results.
You may also be interested in a Java tool for gathering all the media
assets for a VRML scene into one .wrl file. For example, if you
have a .wrl file which uses a JPEG image (.jpg file) for a texture
map, it'll convert the image data into the Data:URL representation and
include it directly in the (modified) .wrl file.
WrlPack from Finlayson Consulting.
Sandy Ressler also collects pointers to a variety of VRML tools at his Mining Company VRML site.
All software provided with VRMLDataTrimmer is provided "as is" with no warranties whatsoever, including any warranty of merchantability, or fitness for any particular purpose, either express or implied. TriVista Technologies, Inc. neither assumes nor authorizes any person to assume for it any other liability.
In no event will TriVista be liable for any loss of profits, loss of
use, direct, indirect, incidental, special or consequential damages arising
out of the use of the Software distributed herein. Use of VRMLDataTrimmer
constitutes your acceptance of this license and subjects you to its contents.