tvlogo1.gif (8585 bytes)
[ Home ]
[ Products ]
[ News ]
[ Contents ]
[ Up ]
[ VRML Info ]

VRMLDataTrimmer

Online Version

This is the online version of the VDT home page:
http://www.trivista.com/products/vdt/vdt.htm

Introduction

VRMLDataTrimmer (VDT) is a simple tool for reducing the size of VRML files. In general, processing a file with VDT will not degrade the file's appearance or performance, but it can make the file a lot smaller (typical reductions are 2-5 times smaller, after Gzipping). VDT was written as a companion program to the CiteMap® Builder, a simple VRML scene creation tool for collections of linked, annotated objects. As such, VDT is designed to be a convenience to CiteMap authors, rather than the be-all and end-all of VRML compression tools. That said, please feel free to try the freeware VDT code on any VRML97 worlds you like (at your own risk).

Running VDT

VDT is a 100% Java application. If you know how run Java with your own Java VM (1.1 or higher), you might just want to use the classes directly. (See README_vdt.htm).

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 Interface

VDT has only one screen. Using it is simple:
  1. select the VRML file you want to reduce
  2. select the reduction options
  3. select the Go button

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

The Reduction Process and Options

VDT does not modify the original file (please don't use the same name for both the input and output file!). The resulting file is not meant to be human-readable. Rather, it is meant to be as small as possible for sending over the Web, while retaining the visible integrity of the VRML scene. The inspiration for VDT is the original Datafat Munger, a Perl script from James Waldrop, released in the days of VRML1.0 (the prefix "M_" actually stands for "Munged"). I'm not sure if James made up the word mung or not. Or maybe he meant munge?

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.00987
The 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.

About

VRMLDataTrimmerTM v.1.0. Copyright (c) 1998 by TriVista Technologies, Inc. All rights reserved. This software is free. You may use, copy and distribute this program as long as all copyright notices remain intact and the application files are not modified in any way. VRMLDataTrimmer is provided "as is" and no warranties of any kind are made. For additional information, see http://www.trivista.com/products/vdt/vdt.htm

License

VRMLDataTrimmer is copyrighted Freeware and may be freely used and distributed provided all copyright notices remain intact and the files are not modified in any way. Please send comments, questions and bug reports to helpvdt@trivista.com. Anyone wishing to distribute this program on a CD-Rom may do so, provided they send 1 copy of the CD-Rom to TriVista Technologies. Please see http://www.trivista.com for the mailing address.

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.


Send mail to webmaster@trivista.com with questions or comments about this web site.
Copyright © 1999 TriVista Technologies, Inc.
Last modified: February 22, 1999