AGOCG logo
Graphics Multimedia VR Visualisation Contents
Training Reports Workshops Briefings Index
This report is also available as an Acrobat file.
Back Next Contents

6 Serving VRML Worlds

6.1 Configuring the Web Server

VRML files are made available on the WWW in the same way as HTML documents, using httpd server software. An updating of the server's configuration files to include the VRML MIME type, is the only change necessary. For example, for a CERN httpd server, the following line would need to be added to the httpd.conf file:
		
	AddType .wrl x-world/x-vrml	8bit	1.0
Other types of server software will require different changes. Refer to the server documentation for more details.

6.2 VRML Optimization and File Compression

File size is an issue which needs to be considered when creating VRML worlds. When a VRML file is large, of more than a Mbyte let's say, many people will be deterred from viewing it. This could be because network transmission rates are slow, so downloading such a large file would take too long, or because the VRML browser and computer system cannot handle complicated models. There are a number of ways in which the size of a VRML file can be reduced and so made more acceptable for browsing on computers with different capabilities.

Use of WWWInline and Level-Of-Detail

Using inline objects can reduce the size of a VRML file quite significantly. For example, the Planet AGOCG scene in section 2 is described in only 43 lines, if however, the geometry of the Starship Enterprise was defined in-file instead of being a WWWInline object, then the file would be over 10,000 lines long.

When WWWInline is used in conjunction with the Level-Of-Detail feature, it allows VRML browsers to optimize their performance. Some VRML browsers, like WebSpace, implement on-demand loading, enabling the user to start viewing and exploring the scene before all the inline data been retrieved. When WWWInline is used with LOD, the least complex representation of the inline object will be loaded and displayed first. More detailed versions of the object will only be loaded if closer views are required. The browser can also use LOD as a hint, allowing it to automatically reduce scene complexity in order to match its rendering capabilities and make movement smoother.

The DATAFAT MUNGER!

The Datafat Munger is a PERL script by James Waldrop that reduces the size of a VRML file by removing excess precision from floating point numbers. It does this by taking all numbers down to 2 digits of precision, making very small numbers equal to zero, and also deleting unnecessary white space such as indents. The reduction in file size can be significant, especially for VRML files created using geometry translators. Polygon normals can also be removed, since the browser will determine them for itself.

GZIP File Compression

Most VRML files on the WWW have been compressed using GZIP. GZIP is one of the GNU tools from the Free Software Foundation. It is widely used because it is freely available for most computer platforms, and can reduce the size of a VRML file by as much as 80 percent. The file extension for a gzipped VRML document is .wrl.gz Most VRML browsers can now automatically decompress gzipped files.

6.3 Server-Side Scripting

Like HTML documents, VRML files can be created on demand by programs running on the Web server, a process known as server-side scripting. The program or script is executed on the server when a Web client makes a request. The output from the program is then sent to the client.

An example of server-side scripting is the Rossetti Room.

The Rossetti Room is a VRML model of the studio of the pre-Raphaelite painter and poet Dante Gabriel Rossetti. Users can select which paintings should be placed in the room, using the checkboxes on the HTML page, see Figure 6-1(a). The model is generated by clicking on the 'Make VRML' button. Figure 6-1(b) shows how the studio model appears when viewed with WebSpace. Each picture in the scene is also hyperlinked to a HTML page containing more information about the picture.

The PERL script which assembles the room can be examined at: http://urban.arch.virginia.edu/~dfa4y/dgr/dgrvrml.pl

Figure 6-1(a) Rossetti Room HTML Page (73K)

Figure 6-1(b) Rossetti Room VRML model (68K)


Back Next Contents

Graphics     Multimedia      Virtual Environments      Visualisation      Contents