Difference between revisions of "Loading models"
(→OBJ and 3DS-format and textures) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 19: | Line 19: | ||
</pre> | </pre> | ||
− | Please note that DOGSKIN.JPG is just the name in the manager. It has absolutely nothing to do with the name of the actual texture file. What this means is, that skinTex in the example-code above can be | + | Please note that DOGSKIN.JPG is just the name in the manager. It has absolutely nothing to do with the name of the actual texture file. What this means is, that skinTex in the example-code above can be instantiated from a different file like: |
<pre> | <pre> | ||
Line 25: | Line 25: | ||
</pre> | </pre> | ||
− | That's all...no magic involved. Just make sure that the names match and you are done. Keep in mind that | + | That's all...no magic involved. Just make sure that the names match and you are done. Keep in mind that they are case sensitive. |
+ | |||
+ | [[Category:jPCT]] | ||
+ | [[Category:jPCT-AE]] |
Latest revision as of 08:16, 18 September 2015
Loading 3ds Models from Blender
Loading 3ds Keyframes from Blender
OBJ and 3DS-format and textures
It's a common problem how to assign textures to a model loaded with the 3DS- or the OBJ-loader. Actually, jPCT does this automatically if one precondition is met: The texture have to be assigned to the TextureManager with the exact same names that the textures have in the model's material definition. Here's an example of a material definition opened in Deep Exploration:
You can see the name of the texture in the select-box at the bottom: DOGSKIN.JPG To make the loader assign this texture to the corresponding dog-model, the TextureManager has to know a texture with this name, i.e. you have to do something like this before:
TextureManager.getInstance().addTexture("DOGSKIN.JPG", skinTex);
Please note that DOGSKIN.JPG is just the name in the manager. It has absolutely nothing to do with the name of the actual texture file. What this means is, that skinTex in the example-code above can be instantiated from a different file like:
Texture skinTex=new Texture("textures/dogtex.png");
That's all...no magic involved. Just make sure that the names match and you are done. Keep in mind that they are case sensitive.