PDA

View Full Version : lws and LWO file Format reference?



deckard
09-16-2005, 02:33 AM
Hi there,

I am programming an external crowd simulation App. Just a small program in VB to automate MDD and Object replacement.

I am running into problems. Hopefully someone can help me out:

LWS Format:
I couldn't find any reference on how certain switches work. Especially the Object referencing.
I.e. when you want to Target an object at a null the line says "TargetItem 10000001". What kind of reference code is "10000001"?

LWO Format:
How do I read it in to get Vertex coordinates? Is the object file in byte format?

Is there a developers documentation around that explains it all?
Any help highly appreciated! Thank you!


deckard

mkiii
09-16-2005, 02:49 AM
Newtek has an SDK page here :-

http://www.newtek.com/products/lightwave/developer/LW80/index.html

It has links to pages covering both file formats amongst other things.

The Null reference is afaik referring to number one of your list of objects :-

The first hex digit (most significant 4 bits) of the hex item number string identifies the item type.

1 - Object
2 - Light
3 - Camera
4 - Bone

The other digits make up the item number, except in the case of bones. For bones, the next 3 digits (bits 16-27) are the bone number and the last 4 digits (bits 0-15) are the object number for the object the bone belongs to. Some examples:

10000000 - the first object
20000000 - the first light
4024000A - the 37th bone (24 hex) in the 11th object (0A hex)

For points it has :-

PNTS { point-location[VEC12] * }
Lists (x, y, z) coordinate triples for a set of points. The number of points in the chunk is just the chunk size divided by 12. The PNTS chunk must precede the POLS, VMAP and VMAD chunks that refer to it. These chunks list points using a 0-based index into PNTS.

The LightWaveŽ coordinate system is left-handed, with +X to the right or east, +Y upward, and +Z forward or north. Object files don't contain explicit units, but by convention the unit is meters. Coordinates in PNTS are relative to the pivot point of the layer.

deckard
09-16-2005, 03:03 AM
That was quick! Thanks a lot! :thumbsup: :)

deckard

mkiii
09-16-2005, 03:57 AM
No probs..... It gave me a chance to slack off work for a few minutes :sleeping: