Author Topic: Multiple textures  (Read 2583 times)

Offline fireside

  • double
  • *****
  • Posts: 605
    • View Profile
Multiple textures
« on: August 06, 2008, 04:23:52 pm »
Can I use the usual setTexture method when there are multiple textures for a 3ds file, or do I have to do something different?  I did a search but i don't quite understand it.  Lets say i have an object with wall.jpg and floor.jpg.  What's the simplest way to add the textures to the object?
« Last Edit: August 06, 2008, 04:30:46 pm by fireside »
click here->Fireside 7 Games<-

Offline Melssj5

  • double
  • *****
  • Posts: 715
    • View Profile
Re: Multiple textures
« Reply #1 on: August 06, 2008, 06:23:20 pm »
the setTexture method will aply the texture to the whole object3d. If you want to change just the floor.jpg texture with another one you have to replace that texture reference in the TextureManager or you can have each textured object as a different object3d.
Nada por ahora

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Multiple textures
« Reply #2 on: August 06, 2008, 07:04:45 pm »
If the textures are already defined in the file itself, the loader will take care of this (read the javadocs or search the forum about to assign textures to a 3ds with texture definitions). If it's a file without textures assigned and you want to assign  them afterwards and the parts belong to one object only, Melssj5 is right.

Offline fireside

  • double
  • *****
  • Posts: 605
    • View Profile
Re: Multiple textures
« Reply #3 on: August 06, 2008, 10:53:06 pm »
O.K.  It was so easy it was going over the top of my head for some reason.  You just name the texture the same name as the file and it's automatic as long as it's before you do the loading.
click here->Fireside 7 Games<-

Offline Melssj5

  • double
  • *****
  • Posts: 715
    • View Profile
Re: Multiple textures
« Reply #4 on: August 07, 2008, 12:02:28 am »
mm Yes, when you export from 3ds max and the name of the file is larger than the 8.3 format then its renamed to fit the 8.3 naming format, in those cases you have to adjust the name of your texture to it.
Nada por ahora

Offline fireside

  • double
  • *****
  • Posts: 605
    • View Profile
Re: Multiple textures
« Reply #5 on: August 07, 2008, 12:41:52 am »
OK, I'll use short names, then.  Thanks.
click here->Fireside 7 Games<-

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11747
    • View Profile
    • http://www.jpct.net
Re: Multiple textures
« Reply #6 on: August 07, 2008, 06:23:18 pm »
Yes, that's a limit in the 3ds format that seems to date back to the "good old" days of DOS.