Making the most of the vrml exporter in 3DS MAX 3 and higher


VRML97 helper tools
The most important and usefull things to assist with creating vrml using 3DS MAX.

Exporter settings

This is covered in the referance manuals that come with 3ds max. This section also explains some vrml principles.
  • Polygon types

    Triangles Creates only triangular faces. No faces have more than three sides.
    Quads Creates four sided faces when all four corners are layed flat. Reduces file sizes with some object types. Has little/no effect on character/animal objects.
    Ngons Creates objects with faces of 3 to n sides. Where n is 20 more higher. Sometimes creates 2 sided faces which are illegal and cause errors to occur when displayed.
    Visable faces Breaks the faces at internal edges that are marked as being visable. I have never used this function.

  • Initial view

    Which camera view will be used on loading scene. All scenes should have at least one camera.

    Initial Navigation Info

    How the users navigates in the World. Valid types are FLY WALK EXAMINE ANY NONE. Examine is rotate, zoom, and move relative to objects in the scene. None is used when a moving camera is used to move around the World. Navigation info is created using the navigation info helper object from vrml 97 toolbar.

  • Initial Background

    Specifies the initial background used in the scene. Backgrounds are created using the Background helper object from vrml 97 toolbar.

  • Initial Fog

    Specifies the fog to be used in the scene. Fog is created using the Fog helper object.

  • Digits of precision

    Number of decimal points to be used in the World. Assuming the scene is accurate 1:1 scale. 0 digits is accurate to 1m, 1 digit is accurate to 10 cm, 2 digits is accurate to 1 cm, 3 digits is accurate to 1mm, and 4 digits is accurate to 0.1mm. Use 2 to 3 digits on most objects and 0 on large terrains etc.
    Reducing the number of decimal points used have a massive effect on file sizes.

  • Show progress bar

    Shows the progress of export. Leave on.

Texture size

Keep texture size, both x and y, and file size to a reasonable limit. Re-use textures where ever possible. Keep texture resolutions as 64, 128, 256, 512 etc, this is the 2^x rule, try to follow it where possible. For example downsize 512x512 textures down to 256x256, 128x128. Doing this makes the textures look better in the vrml world, and also helps the scene render a little faster or use less video memory.

Improving on 3DS MAX vrml code

Remove unused code

The first thing to do is check the .wrl file for Timesensor nodes with a cycleInterval of 3.333 or 0.333 . TimeSensors are used to control animations but max often creates TimeSensors which aren't linked to anything. These are often located just below Lights and have a cycleInterval of 3.333 or 0.333 0.0333 . To find out if a scene which has animations has unused TimeSensors look at the bottom of the file. The ROUTE instruction sends information from timesensors to Interpolators which control the animations. OrientationInterpolators effect rotation or scaleOrientation. PositionInterpolators effect location or scale. CoordinateInterpolators change/morph objects.

If a TimeSensor doesn't have any ROUTEs in the file it can be deleted or commented out by putting # infront of the code lines. The TimeSensor's name will start with the name of the object it controls.

Typical unused timesensor

DEF light01Timer TimeSensor {
 cycleInterval 0.333
}

Typical used Timesensor

DEF ManTimer TimeSensor {
 cycleInterval 10
}

later in file...

ROUTE ManTimer.fraction_changed TO ....

Break up file into sections

VRML allows vrml files to load other vrml files to add more code, functions or objects to the World. This uses the Inline helper tool in 3DS MAX.

You can either save bits of your 3DS MAX scene into seperate vrml files and add the code to whichever file you want loaded first or create a new file which has the Inline code only and Navigation Info and lighting only.


The Inline object tool
Put the file name of an already saved vrml file into the URL dialog box. If you have a scene which you wish the break up into several files, simply hide the objects you don't want in a certain file and then export as normal, by defaul hidden objects aren't exported.

PROTOs are used to create new commands which can be used to transfer information or simplify creation of complex objects. A complete course on PROTOs is beyond the scope of this artice. I will cover this subject at a later date.

PROTO Tree[
field SFVec3f location 0 0 0
]
{
Transform {
translation IS location
children [
Collision {
collide FALSE
children [
DEF Treepanel Shape {
appearance Appearance {
texture ImageTexture {url "tree.gif"}
}
geometry IndexedFaceSet {
coord Coordinate {
point [
-1.5 0.0 0.0, 1.5 0.0 0.0,
1.5 3.0 0.0, -1.5 3.0 0.0,
]
}
coordIndex [ 0, 1, 2, 3 ]
solid FALSE
}
}
Transform {
rotation 0 1 0 -1.0471
children [ USE Treepanel ]
}
Transform {
rotation 0 1 0 -2.0943
children [ USE Treepanel ]
}
]
}
]
}
}

This is and example of a simple PROTO which makes a new object called Tree at location x y z. Many PROTOs are much more complex than this and often have JavaScript programs to calculate functions or make new objects from inputed data.

Tree {
location -3 0 0
}

This makes uses the new tree at location -3 0 0

Create reuse of objects

3DS MAX can clone objects but it uses copy rather than instance. This results in a complete copy of the original rather than a reference to it. VRML allows the reuse of objects which can be moved, scaled, and rotated. Reuse of objects can reduce file sizes massively.

If you have an existing vrml or MAX file that uses copy instead of instance you have two options. The first is to redo the scene in MAX using instance in place of copy. The second is to use a VRML design tool like ISB from Parallel Graphics to do the same task.

Simply load the file into the program and one copy of select the object you wish to copy. Select copy and move, rotate and scale the copy until its in the same postion as the cloned object created by max. Repeat the process copying from the same object each time. You can now delete the max cloned objects and keep the one original and the several copies.