I'm using ms3d. How do I run my animation?

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
Pythy Python
Posts: 30
Joined: Sun Mar 29, 2015 1:31 am

I'm using ms3d. How do I run my animation?

Post by Pythy Python »

Well...since b3d is not working right now I decided to try ms3d. Texture works perfectly fine but now I need to know how to run my animation.

Code: Select all

 
node->setMD2Animation(scene::EMAT_ATTACK);
node->setAnimationSpeed(25);
 
so for ms3d, do I just write

Code: Select all

node->setMS3DAnimaton(scene::idk);
?

also, how come irrlicht has built in functions for md2?
Last edited by Pythy Python on Sat May 09, 2015 6:40 pm, edited 1 time in total.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: I'm using ms3d. How do I run my animation?

Post by CuteAlien »

Ms3d creates a skinned mesh. So I think you use the IAnimatedMeshSceneNode interface for it: http://irrlicht.sourceforge.net/docu/cl ... _node.html
So you have to know the animation ranges and set the loops for those with setFrameLoop

Thought by default it should animate all animations without you doing anything.

And don't know who added and why - that was before my time :-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: I'm using ms3d. How do I run my animation?

Post by hendu »

md2 and md3 have standard animations, being made for Quakes.
Pythy Python
Posts: 30
Joined: Sun Mar 29, 2015 1:31 am

Re: I'm using ms3d. How do I run my animation?

Post by Pythy Python »

Thanks for the replys but I have one more problem. I can't figure out how to animate my box...

Code: Select all

 
    scene::IAnimatedMesh *boxMesh = smgr->getMesh("resource/test.ms3d");
    scene::IAnimatedMeshSceneNode *box = smgr->addAnimatedMeshSceneNode(boxMesh);
    
    smgr->addCameraSceneNode(0, core::vector3df(0, -5, 0), core::vector3df(0, 0, 0), -1, true);
    
    if(box){
        box->setMaterialFlag(video::EMF_LIGHTING, false);
        box->setAnimationSpeed(25);
        box->animateJoints();
        box->setMaterialTexture(0, driver->getTexture("resource/texwall.jpg"));
        box->setPosition(core::vector3df(0, 10, 0));
        box->setRotation(core::vector3df(0, 20, 40));
    }
    
    //camera = smgr->addCameraSceneNodeFPS();
    //camera->setPosition(core::vector3df(0, 0, 0));
    //device->getCursorControl()->setVisible(true);
    
    while(device->run()){
        driver->beginScene(true, true, video::SColor(255, 255, 255, 255));
        
        smgr->drawAll();
        driver->endScene();
    }
    
    device->drop();
    
    return 0;
 
Did I do something wrong?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: I'm using ms3d. How do I run my animation?

Post by CuteAlien »

It's probably ok. Although you shouldn't have to call animateJoints. Can't tell much more without having the model. If it's just a box can you post it online somewhere?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Pythy Python
Posts: 30
Joined: Sun Mar 29, 2015 1:31 am

Re: I'm using ms3d. How do I run my animation?

Post by Pythy Python »

https://www.dropbox.com/s/1o52sg9usof2z ... .ms3d?dl=0

This is my test.ms3d

https://www.dropbox.com/s/isnd9uh1jtvue ... blend?dl=0

This is my blender project file...

Thanks for checking.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: I'm using ms3d. How do I run my animation?

Post by CuteAlien »

Only took a quick look at the ms3d before workm, but I think the problem is that it has no joints. So I guess it's not using a bone-animation and ms3d is only supporting those. I think md2 uses frame based animations. Maybe we should create wiki-page to list the features (and features supported by Irrlicht) of each format.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Pythy Python
Posts: 30
Joined: Sun Mar 29, 2015 1:31 am

Re: I'm using ms3d. How do I run my animation?

Post by Pythy Python »

So I found that ms3d won't export if I have a bone armature...it works fine if there's no animation. So I tried md2 format and now my problem is I can't find my object in the game. It says my object has been loaded perfectly fine(also texture) but I see nothing but my background...what's happening?

Code: Select all

 
scene::IMesh *boxMesh = smgr->getMesh("resource/test.md2");
    scene::IMeshSceneNode *box = smgr->addMeshSceneNode(boxMesh);
    
    smgr->addCameraSceneNode(0, core::vector3df(0, -50, 0), core::vector3df(0, 0, 0), -1, true);
    
    if(box){
        box->setMaterialTexture(0, driver->getTexture("resource/texwall.jpg"));
        box->setMaterialFlag(video::EMF_LIGHTING, false);
        //box->setAnimationSpeed(25);
        box->setPosition(core::vector3df(0, 0, 0));
        box->setScale(core::vector3df(500, 500, 500));
    }
 
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: I'm using ms3d. How do I run my animation?

Post by CuteAlien »

Does it show in the meshloader example?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Pythy Python
Posts: 30
Joined: Sun Mar 29, 2015 1:31 am

Re: I'm using ms3d. How do I run my animation?

Post by Pythy Python »

You mean does model in the tutorial work? yes it does. I don't know why my model isn't showing though.

Can someone give a blender project that works fine with md2? (sorry for requesting...)

(also, sorry for holding this topic too long)
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: I'm using ms3d. How do I run my animation?

Post by CuteAlien »

No - I mean, does your model show up when you load it with the Irrlicht meshviewer (example 9)?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Pythy Python
Posts: 30
Joined: Sun Mar 29, 2015 1:31 am

Re: I'm using ms3d. How do I run my animation?

Post by Pythy Python »

No it doesn't...what do you think my problem is?

this is my blender file.

https://www.dropbox.com/s/l4spq3skb9ae3 ... blend?dl=0


this is md2 file

https://www.dropbox.com/s/x1gx7uwdj1ou0 ... t.md2?dl=0
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: I'm using ms3d. How do I run my animation?

Post by CuteAlien »

It's there - it's just really huge. So the camera is inside of it in the meshviewe. And asd polygons are not double-sided you can't see it from the inide. Move the camera back for a while and at some point it will become visible. Or scale it down.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply