Page 1 of 1

ISceneNodeAnimator already loadable in MeshLoader?

Posted: Mon Feb 08, 2010 1:11 pm
by L o
Hi there,

I am developping a new map format which contains animated textures. I found this tutorial here:

http://irrlicht.sourceforge.net/docu/example008.html

However, the tutorial first calls the MeshLoader:

Code: Select all

scene::IAnimatedMesh* mesh = smgr->getMesh("../../media/room.3ds");
and then adds the filenames of the animated textures to the ISceneNode.

Now, since the filenames for the textures are stored in my map file, it would be necessary to load them in the MeshLoader, and not when my map file is already closed. Is that possible? Or is there a trick to do it?

Greetings,
Lo

Posted: Mon Feb 08, 2010 2:01 pm
by shadowslair
Hi Lo,

I`m not sure I absolutely understand what you mean, but I think you`re trying to load a mesh, having some animated textures in it or sth alike.

First, your textures will be static. They`ll be changed per step using ITextureAnimator attached to the map node as in the tutorial.

Doing the above will put changing textures on your whole map. If you need to have both static and animated parts in your map, say level, you`ll best divide it to one-static textured parts and texure-animated parts.

- The easiest way doing all this is to simply load your level as separate IMeshScene (or whatever) node having its static textures and load different IMeshSceneNodes attached with animators to change their textures.

- The more difficult way doing this having only one scene node, but not that good IMO is to create your own scene node, where each mesh buffer has its own material (as by default), but some buffers will change their texture continuously.

- You can try creating sth like in tutorial "16.Quake3MapShader".

- ... (open for some other solutions)

Posted: Mon Feb 08, 2010 9:19 pm
by L o
Heya,

thanks a lot for this fast response... Still... I am not quite sure if any of those opportunities allow it to already load the whole animations in the IMeshLoader::createMesh(io::IReadFile* file); function. Do you have an idea? Is there any possibility?

Greets,
Lo

Posted: Tue Feb 09, 2010 8:08 am
by hybrid
You need to pass the scene manager or video driver in the mesh loader constructor, then you can access them also in createMesh.

Posted: Tue Feb 09, 2010 2:54 pm
by L o
Thanks, but how do I then access the SceneNode? I tried to find a solution from other MeshFileLoaders, but found none.

Posted: Tue Feb 09, 2010 4:22 pm
by hybrid
There are no scene nodes in mesh loaders. This would only apply to scene loaders, which are not yet available in Irrlicht in this generality.

Posted: Tue Feb 09, 2010 10:08 pm
by L o
Okay, but sorry I am asking again. How do I tell Irrlicht in the IMeshFileLoader that a texture shall be animated?

Posted: Wed Feb 10, 2010 12:21 am
by hybrid
You can't, that's not the job of the mesh. One possibility would be to create a new mesh type, and add methods to this new class which make texture animators available.

Posted: Wed Feb 10, 2010 3:25 pm
by L o
Ok, so, does this mean, that I need to set animated textures (like GIFs) outside the MeshLoader?

Posted: Wed Feb 10, 2010 7:03 pm
by hybrid
Yes, this is typically done by createing a dummy texture, which is named like the texture folder the animation is stored in etc.