Page 3 of 3

Re: Widget request: Extract model data

Posted: 01 Nov 2009, 01:21
by Kloot
Argh wrote: Kloot, do you have any source you'd be willing to share?
Yes and no, respectively (I don't do prefab requests for lazy people). But regarding...
I'm stuck at step 1 of the process: how do we convert the header and the rest of the hex back into a format we can use?
... I'll point you to the bottom section of http://springrts.com/wiki/Lua_VFS.

PS. this is XTA 9.58's core_commander.s3o Lua-converted to .obj:
core_commander.txt
(485.88 KiB) Downloaded 17 times

Re: Widget request: Extract model data

Posted: 01 Nov 2009, 01:37
by Argh
OK, so we'd want to use VFS.Unpack, which is essentially doing what struct does?

Okie doke. Do I have to provide the offset or count?

Re: Widget request: Extract model data

Posted: 03 Nov 2009, 22:37
by lurker
There's a lua .obj reader in tools/

Re: Widget request: Extract model data

Posted: 04 Nov 2009, 01:21
by AF
Im sure somebodies implemented a lua s3o loader of some kind already, if someone can link? I didn't know there was an obj loader in tools though

Re: Widget request: Extract model data

Posted: 04 Nov 2009, 01:42
by FLOZi
Someone (trepan & pressureline) implemented a lua obj loader (including textures) but never a straightforward s3o loader.

Re: Widget request: Extract model data

Posted: 05 Nov 2009, 21:19
by Argh
Meh. I'll look at the one in /tools, see if I can get it to work. And so far as I know, no, there is no straightforward S3O loader, other than whatever Kloot has. Which sucks, because I'd rather keep all of it using the same geometry format, instead of building some of the things I want to try out and then having it be incomprehensibly difficult because it involves thinking about mixed formats, etc.

Re: Widget request: Extract model data

Posted: 10 Nov 2009, 11:14
by Pressure Line
FLOZi wrote:Someone (trepan & pressureline) implemented a lua obj loader (including textures) but never a straightforward s3o loader.
trepan wrote the loader and the .obj->.lua converter, i implimented a use for it

iirc there's draw s3ounitshape... so all you need to do is make a nonsense .fbi for the model you want to use, and then use that. if i knew how to read from a config file (in a similar format to the lups one perhaps?) i could easily finish off the texture-per-object project that i started 2 years ago. kinda like knowing how to build a house, but then realising you dont know how to use a hammer.

Re: Widget request: Extract model data

Posted: 10 Nov 2009, 17:17
by Tribulex
Pressure Line wrote:
FLOZi wrote:Someone (trepan & pressureline) implemented a lua obj loader (including textures) but never a straightforward s3o loader.
trepan wrote the loader and the .obj->.lua converter, i implimented a use for it

iirc there's draw s3ounitshape... so all you need to do is make a nonsense .fbi for the model you want to use, and then use that. if i knew how to read from a config file (in a similar format to the lups one perhaps?) i could easily finish off the texture-per-object project that i started 2 years ago. kinda like knowing how to build a house, but then realising you dont know how to use a hammer.
Thanks but i do not need to DRAW the data using openGL.

Re: Widget request: Extract model data

Posted: 10 Nov 2009, 19:09
by Argh
if i knew how to read from a config file (in a similar format to the lups one perhaps?)
That, I can help with.

include("Configs/yourConfig.lua") where the config is valid Lua. Usually, this means reading a table, or a series of tables.