62
  Modeling
  RWX scripting (with Notepad) (1)
 
The most common used file extension in Activeworlds is .rwx, which is the abbreviation for the Renderware models. The website of Renderware with the software doesn't exist anymore for a long time, but the file format .rwx still exists. The file extension .cob is also often used in Activeworlds, and this is the abbreviaton for the Truespace models (Caligari objects).
The reason why rwx is more popular , is because you can still edit the file with Notepad, even without having to import again into your modeling program(s). Notepad is a very simple text editor, and you will find the entire script of the model in text format.
 
Resources :
 
1. The wiki pages
When you go in the AW menu to : Help -> User Guide -> 3S Designer Topics -> RWX Model Scripts, then you will see the Wiki pages, containing all RWX command scripts that you can use . You can also go directly to the website.
http://wiki.activeworlds.com/index.php?title=Renderware
http://wiki.activeworlds.com/index.php?title=Category%3ARWX_Commands
 
2. Eep's webpages :
http://www.tnlc.com/rw/
In the middel of the webpage you will see a small frame, there you can click upon: "RenderWare Scripting (RWX)" and "Terminology /Script Commands"
 
3. Alusion webpages :
http://www.alusion-fr.com/an1z1.htm
http://www.alusion-fr.com/an1z1.htm
The same , but in french :
http://www.alusion-fr.com/fr1z1.htm
http://www.alusion-fr.com/fr1z2.htm
 
4. Alterlinks webpages :
alterlinks.com/ActiveWorlds/rwx/rwx.php
Example of an rwx-model in Notepad.
Introduction :
 
1. Opening .rwx-models in Notepad ( with the 7-Zip -program )
 
This may not be so simple as it seems : existing rwx-models from the Alphapath or Uberpath, are all zipped files. You need to unzip them first with a zipping program. A good zipping program is 7zip : because it is freeware , and because you can also add an object password ( if you want to). Several objects of the Alphapath or Uberpath have already an object password and can't be opened in Notepad !
For more information , see tutorial page: 10. zip/unzip - object password
Now choose a simple model from the object path , consisting of only 1 flat face. As an example, we choose the model : flata10.rwx
As the model is zipped, we unzip it first :
Right-click upon the object , select "7-ZIP" and then choose "Open archive". Then you will see this in the 7zip program :
 
 
Now you will see the unzipped file of flata.rwx . Now right-click upon flata10.rwx and choose : "Edit" . Now you see the file in Notepad.
The model flata10.rwx in Notepad :
2. File structure in Notepad
 
As you can see, for this example, the command starts with : ModelBegin , and ends with ModelEnd.
Then there is a first part that starts with ProtoBegin , and ends with : ProtoEnd
And there is a second part that starts with ClumpBegin , and ends with ClumpEnd.
 
3. Creating objects with Notepad
 
The example above ( flata10.rwx )is a very simple model (of only 1 surface and 4 vertices) and has already a lot of text lines !
If you choose a sphere object , or cylinder object or another more complicated object , then the text file can have hundreds of text lines, and appear very complex. It is obvious that nobody will start creating a model by writing all those lines with Notepad nowadays.
Notepad will only be used for editing some things to the existing model . Then we think about : modifying the existing texture of the model, scaling the model , making the model transparent, etc.
 
4. Examples of models in Notepad
 
In the example above, we do not know how the model has been created . The model might have been edited with Accutrans, or the model might have been created with Truespace and conversed with the program cobtorwx.
That's why we will use in these tutorials only simple models , and learn more about the structure of the text file.
We will create simple models in Wings3d , and we will export them to .rwx , and then we will open them in Notepad.
Or it will be examples of existing models of the objectpath, which don't have an object password, so that you can open them in Notepad. (You will not be able to unzip the objects with an object password).
 
5. The advantage of using Notepad
 
The existing rwx-models of the Alphapath or Uberpath can't be imported in popular 3d-programs like Wings3d and Blender.
And only with Wings3d , you can export the model into .rwx, but if you have forgotten to save the 3d-file first with the extension .wings, then you can't edit the model anymore in Wings3d (as importing .rwx is not possible).
Notepad is a possible solution : you can open the model in text-file and modify certain aspects of the model.
Another possibility is to use Accutrans, which is a 3d-file converter, but then you will have to learn that program as well.
RWX scripting commands :
 
* Distances for RWX commands
In Renderware, the distances are in decameters . This means, for an object of 4 meters wide, you need to type 0.4
Activeworlds 10 meters 1 meter 10 cm 1cm
RWX 1 0.1 0.01 0.001
 
1. Commands concerning the structure of the script
 
Modelbegin
This command is used at the beginning of the object
 
Modelend
This command is used at the end of the object
 
Clumpbegin
This command is used at the beginning of the construction part of the object.
 
Clumpend
This command is used at the end of the construction part of the object.
 
Protobegin
This command is used for the start of a new prototype. A prototype is a collection of vertices,polygons and materials that can be used repeatedly in the same object. (e.g. the legs of a table).
 
Protoend
This command is used for the end of a prototype
2. Commands concerning the object parts
 
Vertex
This command determines a point in the 3d model, indicated with 3 dimensions :
(x=width y=height z=depth)
This vertex can be follewed by the command UV.
vertex -.4 0 .4
 
UV
This command defines the size of the texture
vertex -.4 0 .4 uv 1 1
 
Quad
This command is used to connect 4 vertex points with eachother, creating a square surface. (a 4-sided polygon)
quad 1 2 3 4
 
Triangle
This command is used to connect 3 vertex points with eachother, creating a triangular surface.
triangle 1 2 3
 
Polygon
This command creates a new polygon , and may gave an optional numeric tag assigned on it.
 
Tag
This command is typed after a quad or triangle , and can be used for making avatars (= clump tags), but also to make sign and picture objects (=surface tags).
quad 1 2 3 4 tag 100
This command creates a surface that can be used to type text. In Activeworlds , such object are called sign objects.
quad 1 2 3 4 tag 200
This command creates a surface that can be used to add an image. In Activeworlds , these are picture objects.
 
3. Commands concerning primitives
 
Block
This command creates a block (e.g. a cube)
(x=width y=height z=depth)
block .1 .2 .1
 
Cone
This command creates a cone
(x=width y=height z=depth)
cone .1 0.05 5
 
Cylinder
This command creates a cylinder
cylinder 0.1 0.05 0.025 8
In this case : 1m high, 1m diameter at the bottom (0.05x2), 0.5m at the top (0.025x2), and 8-sided.
 
Sphere
This command creates a sphere
sphere 0.05 3
The first value is the radius of the sphere (of 1m diameter)
The second value is the density (of the polygons).
 
Hemisphere
This command creates a hemisphere
hemisphere 0.05 3
The first value is the radius of the sphere (of 1m diameter)
The second value is the density (of the polygons).
 
Disc
This command creates a flat disc
disc 0.1 0.05 8
The first value is for the displacement from the ground : 1meter
The second value is radius -> diameter of 1 meter
The third value is the number of sides of the disc
4. Commands concerning the surface of the model
 
Texture
Defines the texture and mask used in the current material
The command Texture must precede the command of the primitive, otherwide the primitive will be without a texture.
 
TextureMode
Defines the texture mode to be used in the current material
 
TextureAddressMode
This option specifies the addressing mode to be used for all following textures.
There are 3 modes : wrap (=default), mirror (=tiled and flipped), and clamp (for masked textures)
 
TextureMipmapState
Specifies the mipmap state of all following textures
 
AddTextureMode
Adds the specified texture mode to the current texture modes
 
RemoveTextureMode
Removs the specified texture mode from the current texture modes
 
MaterialBegin
Sets the beginning of a new material
 
MaterialEnd
Sets the end of a material
 
MaterialMode
Defines the material mode of the current material.
 
AddMaterialMode
Adds the specified material mode to the current material modes
 
RemoveMaterialMode
Removes the specified material mode from the current material modes
 
Color
This command determines the color of a polygon , with the color chart : R G B (red green blue) , and with the default value 1 1 1. (=white). The value of each color ranges between 0 and 1. So, this is not the same as the hexadecimal code , and neither as the RGB code.
On this webpage, you can view the rwx-codes for a wide range of colors : alusion-fr.com/an1z4.htm
color 0.00 0.00 1.00
5. Commands concerning surface effects on the model
 
Surface
Defines ambient, diffuse and specular lighting properties in one command
 
Ambient
Defines the amount that the polygons will be affected by ambient lighting
 
Diffuse
Defines how the objects polygons will be affected by diffuse lighting
 
Specular
Defines how polygones will be affectged by specular lighting. (currently not supported by the Activeworlds program)
 
LightSampling
This command defines how lighting should affect an object overall
 
Opacity
This command determines the opacity / transparency of the model (from 0.0 to 1.0)
Value 1 is default . A value of 0 makes the object invisible.
opacity 0.5
6. Extension Commands / Command options
 
Prelight
This command is an argument option for the vertex command.
 
OpacityFix ( on/off)
This command is used to seperate transparent polygons from eachoterh ,to avoid transparency issues
 
Seamless ( on / off )
This command is used to minimize texture seam issues on neighbouring faces of the model.
 
RandomUVs
This command option generates random texture coordinates to each vertex in the model that doesn't have an UV specified.
7. Commands transformations on the model
 
Rotate
This command rotates the matrix into the give angle. First you define the axises, then the rotation angle (in degrees)
rotate 0 1 0 90
 
Scale
This command scales the existing model (x=width y=height z=depth). You need to type the values for the 3 axises.
scale 5 5 5
 
Transform
This command replaces the current transformation matrix with the specified elements.
 
TransformBegin
Defines the beginning of a new transformation matrix.
 
TransformEnd
Defines the end of the current transformation matrix.
 
Identity
This command sets the current transformation matrix to the identify matrix. This commnad is useful to reset the transformations to the origin.
 
Translate
This command "moves"(translates) the current transformation matrix along the X Y Z axes.
8. Other model properties
 
Collision
This command determines if a model is solid or not
If you want the object non-solid, then type this line after line with "clumpbegin" :
collision off
 
AxisAlignment
This command defines if the model is to be a "facer". There are 4 possibilities : none, zorientx , zorienty and xyz
 
GeometrySampling
This command sets the geometry sampling of the material : sold, wireframe, or pointcloud. Default is solid. Pointcloud is not supported by AW.
 
ProtoInstance
This command adds copies of the polygons in the prototype into the current clump under construction.
This command is used in combination with the commands ProtoBegin and ProtoEnd.
 
ProtoInstanceGeometry
This is equal to ProtoInstance, but the materials are not copied into the clump under construction.
For example; you create a model with same balloons, but for each balloon you want a different color.
9. Unsupported commands (for the AW program )
 
Specular (see above)
Include
IncludeGeometry
Hints
AddHint
RemoveHint
TextureDithering
TextureGammaCorrection
Trace
TransformJoint
Examples
 
There have been added examples of how to use Notepad in the newpages of 2020 :
 
http://www.venice3d.net/2020create65.html