How can i get the texture which in an object

Started by alex, April 27, 2009, 02:13:00 PM

Previous topic - Next topic

alex

how  i  get the texture which in an object after loading 3ds file ?

I want to know which textures(pictures) in an object .please give me some advice,thanks a lot!

EgonOlsen

Depends on what exactly you are interested in. If only the names interest you, there's a method in Loader to get them from a 3DS-file. If you need the actual Texture-instances, you can take these names and use the TextureManager to obtain the actual textures. Another way would be to get the PolygonManager from the loaded object(s), iterate over all polygons and get the texture-IDs from them. Store them all in a set and when done, go to the TextureManager using these IDs and get the textures. If your objects are using only one texture anyway, you can skip the storing part and simply use the texture-ID of the first polygon.