Author Topic: How can i get the texture which in an object  (Read 2665 times)

Offline alex

  • byte
  • *
  • Posts: 19
    • View Profile
How can i get the texture which in an object
« on: April 27, 2009, 02:13:00 pm »
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!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: How can i get the texture which in an object
« Reply #1 on: April 27, 2009, 04:39:27 pm »
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.

Offline alex

  • byte
  • *
  • Posts: 19
    • View Profile
Re: How can i get the texture which in an object
« Reply #2 on: April 28, 2009, 10:29:41 am »
Thanks a lot