www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: efaj on December 28, 2011, 12:57:28 pm

Title: Loader.readTextureNamesOBJ(String filename) plz?
Post by: efaj on December 28, 2011, 12:57:28 pm
Is it possible to get a function like Loader.readTextureNames3DS(String filename) -or at least for what I guess it does- but for OBJ files? I see the OBJ Loader already prints outs the names to the standard output, so I guess it's not that hard. -though maybe lengthy-

I'm writing a function to load an obj as I want simply and shortly, and with my naming rules to auto load the correct textures before the model.
Title: Re: Loader.readTextureNamesOBJ(String filename) plz?
Post by: AGP on December 28, 2011, 07:28:42 pm
A simple mtl parser could do that.
Title: Re: Loader.readTextureNamesOBJ(String filename) plz?
Post by: EgonOlsen on December 28, 2011, 07:33:46 pm
Yes. That's the reason why i never did this...it's obvious. Just load the .mtl file, scan for lines starting with "map_Kd", collect the rest of the line in a set and you are done.
Title: Re: Loader.readTextureNamesOBJ(String filename) plz?
Post by: efaj on December 29, 2011, 03:55:20 am
Yes. That's the reason why i never did this...it's obvious. Just load the .mtl file, scan for lines starting with "map_Kd", collect the rest of the line in a set and you are done.
I know, but I was trying to avoid parsing it twice. But oh well, I haven't seen .mtl files to be large.