www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: fireside on August 06, 2008, 04:23:52 pm

Title: Multiple textures
Post by: fireside 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?
Title: Re: Multiple textures
Post by: Melssj5 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.
Title: Re: Multiple textures
Post by: EgonOlsen 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.
Title: Re: Multiple textures
Post by: fireside 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.
Title: Re: Multiple textures
Post by: Melssj5 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.
Title: Re: Multiple textures
Post by: fireside on August 07, 2008, 12:41:52 am
OK, I'll use short names, then.  Thanks.
Title: Re: Multiple textures
Post by: EgonOlsen 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.