Changing textures!

Started by -Melssj5-, July 10, 2005, 05:10:16 AM

Previous topic - Next topic

-Melssj5-

Hello, can I change the textures of the Object3D while the application is running.

EgonOlsen

The for whole Object3D (i.e. one texture for the whole mesh), use setTexture(...) in Object3D. If you want to modify only parts of the object, things are more complicated and you can use the PolygonManager for this. An example: for (int i=0; i<level.getMesh().getTriangleCount(); i++) {
         level.getPolygonManager().setPolygonTexture(i,TextureManager.getInstance().getTextureID("ql1.jpg"));
}


If you want to modify the texture's pixel data itself, you can use a ITextureEffect for that. But beware that this may be slow when using OpenGL.

Hope this helps.