Jump to content

LWO to OBJ (and now XML), specifically made for Rock Raiders models

Recommended Posts






A quick and dirty tool for converting Rock Raiders models (.LWO + .UV) to OBJ, just cause I got annoyed there was nothing that handled the texture mapping properly/at all (generating UV coords from the planar texture info, or loading them from the occasional .UV files)


Animations/full creatures and buildings etc are another deal entirely (.LWS files; scenes comprised of LWOs), I make no promises as to if/when I might tackle that but it'd be in a separate, more extensive project


Select/multiselect as many LWOs as you want and it'll plop the OBJs/MTLs right along side 'em, just remember LRR puts some things in special "Shared" folders so if some textures aren't present, look there




You can also dump LWOs as XMLs and back again, to make simple tweaks easier (changing texture paths, colors, etc without a hex editor) or to more easily debug why one model may be crashing the game or whatever (comparing it with a working file, removing/changing chunks until it works, etc). It handles the bulk of the chunks used by the game's models (certainly all the chunks the game actually reads), others it doesn't recognize just have their raw hex dumped (so if for some reason you need to tweak them you still can).


Note that due to the nature of floating point numbers, unless you tick the boxes for it, it won't turn those into text by default (it'll dump the raw contents as you'd see in a hex editor instead), to avoid minuscule differences creeping in (you probably won't need to be editing these by hand 99% of the time anyway) . Practically speaking it won't matter in-game even if that does happen, you'd never see a visual difference. It just makes direct file comparison easier when things match truly 100%.


If you wanna know what the hell you're even looking at in the XMLs, here's some format documentation that explains it:



The only inaccuracy I found was that angles (i.e. surface smoothing angles) seem to be stored in radians, not degrees. But that doesn't even matter because LRR doesn't read/use any chunks like that. In fact, going by Cyrem's reverse engineering efforts (aka poking the exe with a stick), it seems the only chunks (and SURF sub-chunks) the game pays attention to are:


And not even all of those are actually used in practice - same goes for the surface and texture flags.


Oh yeah, and the 4th (supposedly unused) byte in color chunks is typically 00 but the exporter in Lightwave 8 writes FF instead. It's probably of no importance.



  • Rock Raiders often leaves certain textures unfiltered to create an appearance of crisp seams between bricks on low resolution textures, but sometimes their choices on what textures to do it on were a bit weird - the Power Station is a great example: https://www.rockraidersunited.com/topic/8156-rock-raiders-models-uv-files-x-files-texture-filtering-and-the-shared-folder/ Basically, if something looks too blurry when you think it should look sharp, try messing with the settings for the texture in whatever program you're using (i.e. in Unity, enable point filtering for the texture under Filter Mode)
  • Chief's models are flipped on X, inside out. His animation then scales him to -1 on X, making the faces appear the right way around, but with flipped vertex normals. Why? So the lighting from the cursor - behind him - makes him appear lit from the front. I've included an option to flip models on X, so you can get Chief's models as they appear once animated in-game.
  • Vertex normals are generated by the game at runtime, and the game ignores any smoothing angles that may be set in the LWO; hard edges are purely handled by which verts are welded/unwelded
  • Rock Raiders often adjusts the scale of misc things in the animations (like the minifigure head), keep an eye out for that if you're assembling these together manually


Some screenshots of converted models in another program:











Share this post

Link to post
Share on other sites

Updated so it describes more surface properties in the MTL comments, i.e.

# Surface name:  Newbit top yellow grill SidesX
# Surface flags: None
# Color (RGB):   197 254 1
# Luminosity:    0 (0%)
# Diffuse:       256 (100%)
# Specularity:   166 (64.84375%)
# Glossiness     256 (100%)
# Reflection:    0 (0%)
# Transparency:  0 (0%)
# Texture flags: X, PixelBlending, Antialiasing
# Texture path:  \\Mother\LEGO\Meshes\Lowpoly\Buildings\Refinery\NEW-side.bmp
newmtl Newbit_top_yellow_grill_SidesX
map_Kd NEW-side.bmp

still need to figure out just how much of that can be properly translated to the OBJ/MTL format...

Share this post

Link to post
Share on other sites

hi it dumps them to XML now too I think it's actually done now goodbye sleep bed zzz

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.