Skip navigation

LightWave 3D OBJ Export v2.1 is completely screwed up

In this model I have, it does the most ODD things.

One thing it does (but this is valid, just I didn’t expect it) is it uses negative texcoord indices sometimes (so f 5/-1 126/-2 140/-3 52/-4). Negative indices just means to use the last vt, 2nd last vt, etc.

The thing it does apparently wrong is it DOES NOT include any newmtl statements, or a mtllib file, and it uses usemtl statements as if they are _IMAGE FILENAMES_ (really its supposed to be map_kd, or map_ka).

The quick fix is to add code:
– if usemtl is attempted but that mtl doesn’t exist, create it and see if there is an image with the same filename as the mtl. If there is, load it and use it for that mtl.
– check the vt index and if it is negative, use the -whatever vt coordinate from your current point in the file

These aren’t _that bad_, but they really should follow the file format correctly

Also, it exports non-convex polygons.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: