Question regarding the 3DS loading process

Started by Klaudiusz, September 28, 2007, 03:28:10 PM

Previous topic - Next topic

Klaudiusz

Hi,

While the 3DS file is loaded, some materials and textures are created:

QuoteFile head2.3DS loaded...79376 bytes
Processing new material Material #25!
Texture named AFRICAN_.JPG added to TextureManager!
Processing new material Material #26!
Processing new material Material #27!
Processing new material Material #28!
Texture named EYE_DARK.TIF added to TextureManager!
Processing new material Material #29!
Processing new material Material #30!
Processing new material Material #31!
Processing new material Material #32!
Processing new material Material #33!
Processing new material Material #34!
Processing object from 3DS-file: head2
Object 'head2_jPCT0' created using 2880 polygons and 1487 vertices.

I suppose those textures are created as dummy.

How can i remove this creating? (I havy my own texture loader and i'm affraid whether the name of some new texture can be taken by some of the dummies)
What it's "new material Material #**" ? What's that mean in JPCT?

Thank You

EgonOlsen

#1
Yes, those textures are dummy ones and they have to be created to be able get a reference to the textures in the 3ds. You can replace them  via the TextureManager (by name) or (and better), add textures with that names to the manager before loading the 3ds. Then, the loader will not create new ones but use the existing ones.
The materials are part of the 3ds-format. They may contains texture and/or color information. jPCT is using some information from those materials, but not all.

Kearnan

You can use one of these...

public static String[] readTextureNames3DS(String string) { return null;}
public static String[] readTextureNames3DS(URL uRL, String string) { return null;}
public static String[] readTextureNames3DS(InputStream inputStream) { return null;}

... to collect a convenient list of texture names from the model.  I use those to audit my world file (where I save my world structure).  It seems, to me, that textures should be loaded with your own method before the 3DS model (as models use textures and textures don't use models, but then you'd need to create a list beforehand) if you'd rather not have the "load3DS" method create dummy texture names.  Although, I haven't seen that it makes any real difference by the time everything is loaded beyond the duplicate texture warning.