Introduction
An RWX file is a text script that builds a 3D model. It is RenderWare’s script format: RenderWare was Criterion Software’s 3D graphics library of the 1990s, and the demo program on the disc this page was checked against is “RenderWare v2.1 MS-Dos Demonstration Program”, dated 1997. Netscape’s Live3D plug-in kept the extruded letters of its 3D text in RWX files, one for each character, and Active Worlds, the 3D chat world, builds its objects from them.
A model is written as commands, one to a line: Vertex to place a point,
Triangle, Quad and Polygon to join points into
faces, primitives such as Block and Sphere, transforms such
as Translate and Rotate, and material commands such as
Color that colour what follows. Parts are nested in
ClumpBegin and ClumpEnd, and parts that are used more than
once are named as prototypes and instanced.
The .rwx script has nothing in common with RenderWare’s binary files,
.dff, .txd and .rws, which belong to RenderWare
Graphics from version 3 and are chunk-based binary files. The maker and the word
“clump” are all they share.
Structure
An RWX file is plain text. The first lines are usually # comments, then
ModelBegin opens the model and ModelEnd closes it. Between
them are clumps, prototypes and commands. Commands are not case sensitive, white space
between words is free, and a # starts a comment that runs to the end of
the line. The files on this Mac end their lines with CR LF, as DOS and Windows write
them.
This is the whole of 033.RWX, the glyph for “!” from the Live3D data
folder of Netscape Navigator 3. Vertices are numbered from 1 in the order they appear,
and each Polygon gives a count and then that many vertex numbers.
# RenderWare(tm) Extruded Text
# Glyph !
# Character cell x offset = 0.303030
# Character cell y offset = 0.000000
ModelBegin
ClumpBegin
Hints HS Editable
Vertex 0.121212 0.159420 0.000000
Vertex 0.106061 0.516984 0.000000
Vertex 0.106061 0.666667 0.000000
Vertex 0.196970 0.666667 0.000000
Vertex 0.196970 0.516984 0.000000
Vertex 0.181818 0.159420 0.000000
Vertex 0.106061 0.000000 0.000000
Vertex 0.106061 0.086957 0.000000
Vertex 0.196970 0.086957 0.000000
Vertex 0.196970 0.000000 0.000000
Surface 0.4 0.6 0.6
LightSampling Vertex
Color 1.0 0.0 0.0
Polygon 4 10 9 8 7
LightSampling Vertex
Color 1.0 0.0 0.0
Polygon 6 6 5 4 3 2 1
ClumpEnd
ModelEnd
The first bytes of a script from RenderWare’s own demonstration disc, the articulated
human HUMAN.RWX, show the line endings:
00000000: 2320 5265 6e64 6572 5761 7265 2854 4d29 # RenderWare(TM)
00000010: 2053 6372 6970 7420 4669 6c65 0d0a 2320 Script File..#
00000020: 416e 2061 7274 6963 756c 6174 6564 2068 An articulated h
00000030: 756d 616e 206d 6f64 656c 2e0d 0a0d 0a4d uman model.....M
00000040: 6f64 656c 4265 6769 6e0d 0a20 2020 2050 odelBegin.. P
00000050: 726f 746f 4265 6769 6e20 4c65 6674 4172 rotoBegin LeftAr
ModelBegin and the start of ProtoBegin LeftArm, every line ending in 0D 0A.Space and handedness
RenderWare’s space is left-handed: x runs to the right, y up and z away from the
viewer. That is how RenderWare and Active Worlds are documented and is not something
any file on this Mac states; the numbers carry no units. The viewer on this site draws
with a right-handed picture plane, so it flips z to show a model the way a left-handed
viewer would. The directions of Rotate agree with this: in
TRIAD.RWX an arrow along y, turned by Rotate 0 0 1 -90 and
Rotate 1 0 0 90, lands on the x and z axes where the file puts the
letters X and Z.
In this reference
- Syntax and structure – lines, comments, the begin and end commands, what each block saves, and a table of every command
- Vertices and faces –
Vertex,Triangle,Quad,Polygon, numbering, concave polygons and holes - Primitives –
Block,Cone,Cylinder,Disc,Hemisphere,SphereandTorus, with where each sits - Transforms –
Translate,Rotate,Scale,Transform, the joint commands and the order they apply in - Materials –
Color,Surface,Opacity,Texture, the sampling modes and prototype instances
What the viewer shows
Drop an .rwx file on the explorer and it runs the commands the way a
viewer does, in your browser: it keeps the current transform and material, builds the
vertex list of each clump, tessellates the primitives and instances the prototypes. The
Model tab has five pictures: three-quarter, front, side, top and a wireframe. The Text
tab shows the file. The Overview tab lists the commands used, the prototypes with their
instances, the materials with the number of faces in each, the textures named, and every
problem found, such as a face that names a vertex that does not exist or a block that
is never closed. The tree maps every byte of the file to a command, a comment or a
blank line, with the blocks nested.
Textures are separate bitmaps named in the file and are not drawn: a textured face is
drawn in its Color. Primitives are cut into polygons by the viewer, with
its own choice of how many, because the files do not say.
Files this was checked against
The reader was run over the 114 .rwx files found on the author’s Mac:
94 Live3D glyph files (the characters ! to ~, named by their ASCII code, 033 to 126),
four scripts from RenderWare’s 1997 demonstration disc (BANANA,
HUMAN, TABLE and TRIAD) and a detailed
HEAD model. Some are copies of each other, which leaves 99 different
files. They all parse without a problem, every byte of each belongs to a node of the
tree, and the pictures were looked at. TRIAD draws an x, y and z axis with
arrows and letters, which settles the direction of Rotate and the order of
transforms. Details that none of these files use, and what the reference could not
check, are marked on the pages.
Not described
The reference was written from four demonstration scripts, a head model and 94 glyph files, not from RenderWare’s own documentation, so some of it is inferred.
| Item | Reference | Viewer |
|---|---|---|
| RenderWare’s manual | Not available; rules are read from the sample files or from the author’s memory, and marked where so. | Follows the same reading, so it can differ from RenderWare. |
| Active Worlds extensions | Tag, Collision, AxisAlignment, Ambient, Diffuse, Specular and the mode words are unverified; no sample file uses them. | Keeps the words and ignores them. |
| Textures and Opacity | Texture bitmaps are not described beyond their names; no sample has a textured face. | Does not draw textures (the Color is used) and only blends Opacity toward the background. |
| Round primitives | How many polygons RenderWare makes of a sphere, hemisphere, torus or cone is unknown. | Uses its own counts. |
| Lighting and surface | The effect of Surface, LightSampling and GeometrySampling is not described. | Lights every face the same, flat, filled and double-sided. |
| Hints | The meaning of HS and Editable is unknown. | Lists them in the overview only. |
Links
Software
- Active Worlds – 3D chat world whose objects are RWX models (Windows)
- Netscape Live3D – the Navigator 3 plug-in whose data folder holds the glyph files (Windows)
- RWVIEW – the RenderWare 2.1 demonstration viewer, which takes RWX scripts (MS-DOS)