ISceneNodeAnimator already loadable in MeshLoader?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
L o
Posts: 44
Joined: Sun Mar 29, 2009 2:53 pm

ISceneNodeAnimator already loadable in MeshLoader?

Post 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
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post 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)
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
L o
Posts: 44
Joined: Sun Mar 29, 2009 2:53 pm

Post 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
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
L o
Posts: 44
Joined: Sun Mar 29, 2009 2:53 pm

Post by L o »

Thanks, but how do I then access the SceneNode? I tried to find a solution from other MeshFileLoaders, but found none.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
L o
Posts: 44
Joined: Sun Mar 29, 2009 2:53 pm

Post by L o »

Okay, but sorry I am asking again. How do I tell Irrlicht in the IMeshFileLoader that a texture shall be animated?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
L o
Posts: 44
Joined: Sun Mar 29, 2009 2:53 pm

Post by L o »

Ok, so, does this mean, that I need to set animated textures (like GIFs) outside the MeshLoader?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post 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.
Post Reply