RWX avatars
Getting a 3D model out of a modelling program and into Worlds as something you
can wear. The format is .rwx, RenderWare's text-based object script
— it opens in a text editor, and that is the part that saves you when
something goes wrong.
Expect an afternoon the first time. Most of it is conversion steps, and most failures are texture problems rather than model problems.
What you need
| Tool | For |
|---|---|
| A 3D modeller (Blender is fine) | getting the model to the right size and polygon count |
| AccuTrans 3D | converting OBJ to RWX. This is the step nothing else does well |
| An image editor | resizing and flattening textures |
| CMPCreator | converting BMP to Worlds' own CMP texture format |
| A text editor | editing the RWX by hand. You will do this |
You do not strictly need CMP — 8-bit BMP works — but CMP is what the client is happiest with and what the original content uses.
1. Get a model
Make one, or start from something existing. Import it with its textures intact, because you will need to know which texture belongs to which part later.
2. Cut the polygon count down
This engine is from 1995 and it is not going to render an 80,000-triangle model. Check the face count in your modeller's statistics.
| Faces | Verdict |
|---|---|
| up to ~5,000 | comfortable |
| ~10,000 | pushing it |
| more | it will hurt, and it will hurt everyone else in the room too |
In Blender, add a Decimate modifier and pull the Ratio down — between 0.20 and 0.50 is usually the right neighbourhood. Watch the face count as you drag, and watch the model: past a point the silhouette collapses and a face stops being a face. Back off before that.
3. Position it
This is the step people skip and then wonder why their avatar is on its side, underground, or the size of a building.
Worlds expects a particular orientation. Lay the model out horizontally, facing upward, centred on the origin, with its midline on the axis running through the middle. A dimensions template — a reference shape at avatar scale that you import, line up against, and then delete — turns this from an hour of guessing into ten minutes.
Scale against the template too. Something around normal human height reads correctly next to everyone else; a model twice that will get you told about it. Delete the template before exporting.
4. Export to OBJ
Export as .obj into the same folder as your texture files. Keeping
everything in one folder from here on removes an entire class of problem.
5. Convert OBJ to RWX
Open the OBJ in AccuTrans 3D and use Save with Options:
- Choose RWX as the output format.
- Turn on the material and texture export options — without them the RWX comes out untextured and you will be writing the texture lines by hand.
- Save with a short, lowercase name.
6. Prepare the textures
pompom.bmp. Long or
mixed-case names are a reliable way to end up with a blank shape.
Flatten to 8-bit BMP in your image editor. Then, for CMP:
- Put
CMPCreator.bat,compimg.exe,cmpview.exeand your.bmpin the same folder. - Run
CMPCreator.bat. It asks a short series of questions: language, output format, one image or several, the filename, and whether you want transparency. - It writes three files. Keep the
.cmpand delete the.210and.pa2— intermediates.
Worlds recompresses textures on its own, so expect some pixelation no matter how clean your source is. Do not spend an hour on a 2048px texture that will be shown at a fraction of that.
7. Edit the RWX by hand
Open the .rwx in a text editor. Two changes.
Point the texture line at your file
Find the Texture line and set it to your converted texture, with no path:
Texture pompom.cmp
Replace the diffuse line with a surface line
Find Diffuse 1.0 and replace it with:
Surface 0.580000 0.150000 0.150000 TextureModes Foreshorten Lit LightSampling Vertex
| Part | What it does |
|---|---|
Surface + three numbers |
How the model reacts to ambient light. These values are a neutral starting point — raise the first if your avatar comes out too dark. |
TextureModes Foreshorten Lit |
Correct perspective on the texture, and the model responds to the light in the world instead of being flatly lit. |
LightSampling Vertex |
Lighting computed at the vertices. The cheap option, and on a model this size the right one. |
ClumpBegin blocks — one per part. Do both edits
inside every block, each pointing at its own texture. Missing
one is why an avatar comes out with a correctly textured head and a white body.
8. Put it in the client
The .rwx and its textures go in the same directory.
The RWX names its textures without a path, so the client looks for them beside
it.
- File → Console Properties...
- Find the Avatar (URL) field.
- Put in the location of your
.rwxand press OK.
A local path works while you are testing:
C:\Users\you\avatars\mymodel\avatar.rwx
A URL works too, and is how other people see it — the model has to be somewhere they can fetch it from, not on your disk.
http://, not https://. The client
runs on a Java 6 runtime whose TLS stopped being usable years ago. The
modified client can do https through its own
fetch path; the plain client cannot, and an https avatar URL simply fails with
no useful message.
9. When it does not work
| What you see | Usually |
|---|---|
| Nothing loads at all | A syntax error in the RWX. You edited it by hand; read the lines you changed. A missing keyword or an extra number is enough. |
| The shape is there but untextured | The texture filename in the RWX does not match the file, the file is not beside the RWX, or it is still a PNG. |
| Parts of it are inside out | Inverted normals. Recalculate them in your modeller and re-export. |
| One part textured, the rest white | You edited one ClumpBegin block and not the others. |
| It is enormous, sideways, or buried in the floor | Step 3. Go back and line it up against a template. |
| Everyone in the room, you included, turns into the same default figure | Not your model at all. The client filters avatars against a list it fetches from the server, and when that fetch fails it silently replaces every non-default avatar with the standard one. In the modified client Tools → Avatars reads that state and tells you in a sentence. |
10. Sharing it
Put the .rwx and its textures on any web host that serves plain
files over http, and give people the URL. Both servers in this project can host
content for you — that is what the built-in HTTP server is for, and
docs/15-hosting-content.md covers letting other people host their
own.