PDA

View Full Version : LWO2 file format DOC(TAGS->Surface ID)


SilentScream
10-04-2010, 01:56 PM
Hi, i am working on parsing LWO2(almost finished). But i've encountered a problem getting real surface id(Used in PTAG->SURF). It's so unobvious. Documentation just says "the tag is given by an index into the previous TAGS chunk". May be that's because my English sux, but i just don't get it. I can't find anything that looks like surface id in the TAGS chunk.

http://trueimages.ru/img/7c/a2/38d1430d31c0b4ae2d33aec8dfe.jpg

There's TAGS chunk in above example. Real Singular0 surface id, used in PTAG->SURF is "8". I just can't see any relation.

Lightwolf
10-04-2010, 02:56 PM
TAGS stores multiple strings (basically an array).
PTAG->SURF stores an index into the TAGS array
You use the TAGS string with the index to find the name of the surface that the polygon is surfaced with (which is the first entry in a SURF chunk).

Cheers,
Mike

SilentScream
10-04-2010, 03:10 PM
Yeah, i've just figured out it myself. My bad, i didn't count "...\0.000000 1.000000 0.000000" bytes as strings. But then i've just watched and counted strings by null bytes - i've got it. Just for lulz: my first attempt to detect SID was counting null bytes after DkBlu. I really don't remember, how i came up with it. But it worked...Randomly.

Anyway, thanks for your reply, i thought no one will answer.

Lightwolf
10-04-2010, 03:13 PM
Anyway, thanks for your reply, i thought no one will answer.
You never know... these forums can surprise you either way ;)

And you're very welcome...

Cheers,
Mike

hurley
10-04-2010, 03:41 PM
These days if you parse the default box, you'll get 2 PTAG chunks instead of the 1 described in the SDK doc's Object File Example.

As far as I can tell the new PTAG refers the polygons's color(Dark Blue). When in Modeler, you can see this if you open the Polygon Info panel.

What I can't figure out is how you can change this color in Modeler and why is it now stored in the object file. I thought it might be the Sketch color, but changing the Sketch color and saving the object doesn't change the PTAG.

Anybody know what it's for?

-Steve

SilentScream
10-04-2010, 03:47 PM
I'm confused too with this DkBlu tag. Maybe Wireframe Color?

hurley
10-04-2010, 03:59 PM
I'm confused too with this DkBlu tag. Maybe Wireframe Color?

Could be but we can only guess until the documentation is updated.

I do know that it is a type 'COLR' and not a 'SURF". I just ignore it in my parser.

Just in case you haven't seen it, there's a good sample LWO2 reader( SDK->sample->Utility->lwobject ) that you might find helpful.

-Steve

SilentScream
10-04-2010, 04:20 PM
it's too late. My crappy parser is 95% ready(only some tuning left like colr attributes and some intensity attributes). Crappy because it's code is unreadable rubbish and it has some bottlenecks(like accepting only specific surface names in specific order)). But i don't care, cause i'll make my own file format and internal engine parser for it. Anyway i need all data preprocessed and unordered chunks sucks to parse.