PDA

View Full Version : Different textures?


andi
30th October 2003, 06:53 AM
Hi
Yet another problem with the SDK in my .3ds importer:
I use
ok = search_and_set_texture(object, g_filename, texture);
to apply a texture to an object. g_filename if the filename, as given to the loading function of the plugin. texture is the name of the texture as it appears in the .3ds file.

For most models this works perfectly. But some models seem to have problems: only a _single_ texture is used for all objects, although the model uses different textures.
The function call uses the correct values for the "texture" parameter, according to the printf() I added next to it.
Also according to ac_object_get_texture_index(object) the objects actually use different textures.

I have the impression that this is due to a more complex hierarchy of the model. This particular model looks (in the .3ds file) like this:

- Box04
- $$$DUMMY
- rocketbo10
- rocketbo11
- rocketbo12
- [...]
- Box02
- $$$DUMMY
- Box03
- Box03
- Box05
[...]


Where $$$DUMMY objects are objects that do not contain any faces.

Other models have $$$DUMMY objects on top level only.
Could this be related?

Any hints why only one texture appears?

CU
Andi

Andy
1st November 2003, 06:16 AM
AC3D objects allow one texture per object.

Currently, if you need to have >1 texture per object (i.e. collection of surfaces), you should either create a single texture which is a composite of all textures used on one object, OR cut away surfaces that share the same texture and put them in inidivdual objects.

Andy

andi
1st November 2003, 06:31 AM
Thats exactly what I mean - I have one texture per object (one for Box04, one for rocketbo10, one for rocketbo11, one for rocketbo12, ...).
But only a single texture is displayed for the whole _model_

CU
Andi

Andy
1st November 2003, 06:35 AM
Send me the .ac file with the textures and I'll have a look.

Andy

andi
1st November 2003, 01:35 PM
Hi
the problem has been resolved now:
search_and_set_texture() does not only apply to the object itself, but also to all child objects.

I had not thought about this.

CU
Andi

Joz
8th April 2005, 10:24 AM
Hi
I'm interting in know how can i set 2 or more textures in 1 object!.
Can anybody send me an example.
Joz