RWX Keywords
When you open an .rwx model in a text editor, you will see these terms used to define the model and it's attributes.
Lighting
Ambient
Defines how ambient lighting affects a clump.
Format: Ambient a
a
: The ambient value from 0 to 1.0
Location: After ModelBegin
or ClumpBegin
Diffuse
Defines how diffuse lighting affects a clump.
Format: Diffuse d
d
: the diffuse value from 0 to 1.0
Location: After ModelBegin
or ClumpBegin
Without any lighting, your model will be completely black. The usual solution is to use Diffuse 1.0
directly after ModelBegin
.
Specular
Defines how specular lighting affects a clump.
Format: Specular s
s
: The specular value from 0 to 1.0
Location: After ModelBegin
or ClumpBegin
Surface
Shorthand for defining all 3 lighting types in one line.
Format: Surface a d s
a
: The ambient value from 0 to 1.0
d
: the diffuse value from 0 to 1.0
s
: The specular value from 0 to 1.0
Location: After ModelBegin
or ClumpBegin
You may see Surface 1.0 1.0 1.0
in each clump after converting a model with AccuTrans 3D. This will make your model appear entirely white.
I usually delete these lines and define lighting values individually as needed.
Texture
Color
Defines the base color of a clump when there is no texture.
Format: Color r g b
r
: The percent of red from 0 to 1
g
: The percent of green from 0 to 1
b
: The percent of blue from 0 to 1
Location: After ClumpBegin
To convert a normal RGB color to this format, divide each number by 255.
GeometrySampling
Defines how faces are rendered.
Format: GeometrySampling n
n
: solid, wireframe, or pointcloud
Location: After ClumpBegin
solid
is the default value. wireframe
shows only the edges. pointcloud
shows only the vertices.
LightSampling
Defines how faces are rendered.
Format: LightSampling n
n
: facet or vertex
Location: After ClumpBegin
facet
is the default value. vertex
will make the edges of your model much smoother looking.
Texture
Defines an image texture for a clump.
Format: Texture filename
filename
: a .bmp, .cmp, or .gif image
Location: After ClumpBegin
With .gif textures, black (#000000) will be rendered as transparent.
TextureMode
Defines options for image textures.
Format: TextureMode value value2(optional)
option
: lit, foreshorten, or filter
Location: After ClumpBegin
lit
is the default, meaning lighting will affect the texture.
foreshorten
will prevent textures from warping when viewing them from different angles.
Multiple values can be used. foreshorten lit
is a common combination.
Opacity
Defines transparency of a clump.
Format: Opacity x
x
: The opacity value from 0 - 1.0 where 1.0 is totally opaque and 0 is totally transparent.
Location: After ClumpBegin
MaterialMode
Only used with double to create double-sided faces.
Format: MaterialMode double
Location: After ClumpBegin
In 3D modeling, a face is usually only rendered on one side. This
keyword lets you have a face with textures on both sides without adding
extra geometry.
AxisAlignment
Used to make a clump always face the same direction relative to the camera.
Format: AxisAlignment alignment
alignment
: zorientx, zorienty, xyz
Location: After ClumpBegin
Transform
TransformBegin
Defines a section to be affected by other transform keywords. Used with TransformEnd.
Everything nested within each TransformBegin and TransformEnd will be affected.
A TransformBegin inside another TransformBegin will be transformed reletive to the outer layer.
Scale
Resizes the model.
Format: Scale x y z n
x
: The scale in the x direction.
y
: The scale in the y direction.
z
: The scale in the x direction.
Location: Within a transform block.
Negative values can be used to turn parts of the model inside-out.
Rotate
Rotates the model.
Format: Rotate x y z n
x
: If the rotation is about the x axis, either 0 or 1.
y
: If the rotation is about the y axis, either 0 or 1.
z
: If the rotation is about the z axis, either 0 or 1.
n
: The angle of degrees to rotate about the axis.
Location: Within a transform block.
Translate
Moves or slides the model in 3D space.
Format: Translate x y z
x
: The distance to move along the x direction.
y
: The distance to move along the y direction.
z
: The distance to move along the z direction.
Location: Within a transform block.
Transform
Shorthand for applying Scale, Rotate, and Translate on one line.
Format: Translate a b c d e f g h i j k l m n o p
Don't use this. It's harder to read and doesn't do anything differently than using the individual keywords
and requires mathematical knowledge of matrix transformations.
Structure
These keywords define structure of the file. These will usually be generated by whatever conversion program you use.
ClumpBegin
Defines a section of the model, usually all the parts with the same texture. Used with ClumpEnd
Triangle
Defines a triangular face.
Format: Triangle x y z
x y z
: The location of each corner vertex.
Location: After ClumpBegin, generated after converting your mode.
Quad
Defines a quadrilateral face.
Format: Quad w x y z
w x y z
: The location of each corner vertex.
Location: After ClumpBegin, generated after converting your model with the Quads option.
Vertex
Defines a vertex.
Format: Vertex x y z UV uv
x y z
: The vertex location.
uv
: The texture coordinates for the vertex.
Location: After ClumpBegin, generated after converting your model.
Comment
Begins a comment.
Format: #text
#comments are ignored when rendering the model.