Moving bones

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
diegomazala
Posts: 14
Joined: Fri May 18, 2007 12:09 am
Contact:

Moving bones

Post by diegomazala »

Hello.
I am new on this forum and in games also.
I need implement a small character and move it.
I have some doubts:
- The model file should be? ( .3ds, .x, .max, .obj )
- How can I load and move the mesh?

Code: Select all

irr::scene::ISceneNode* node = 0;
node = smgr->addMeshSceneNode(
smgr->getMesh("../data/hand.3ds")->getMesh(0,255) );

Thank's

Diego
LLDD
Posts: 43
Joined: Fri May 11, 2007 9:50 am

Post by LLDD »

You should use a format that supports animation, like .x for example. And read the examples ;)
________
JUSTIN BIEBER FANS
Last edited by LLDD on Sun Feb 20, 2011 2:11 am, edited 1 time in total.
diegomazala
Posts: 14
Joined: Fri May 18, 2007 12:09 am
Contact:

Post by diegomazala »

Hello, LLDD
Thank you for attention

I am reading the examples and not understand every all.

About your answer, ok. I will create my model and export how .x
Now, how can I handle the pieces of my mesh?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Usually you do the complete mesh in one object. You define several animations with your 3d modelling tool and call them in Irrlicht to show the animation. So you don't need to access parts.
diegomazala
Posts: 14
Joined: Fri May 18, 2007 12:09 am
Contact:

Post by diegomazala »

Ok, so I need modeling my object and make an animate.
For example, from frame 30 to 90 it punch.

Then, my code could be like this:

Code: Select all

irr::scene::IAnimatedMeshSceneNode* anms = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../data/model.3ds"));
anms->setFrameLoop(30, 90);
anms->setAnimationSpeed(40);
Is it correct?[/code]
Perceval
Posts: 158
Joined: Tue May 30, 2006 2:42 pm

Post by Perceval »

Yes, except that 3ds models are static in irrlicht (use .x instead)
diegomazala
Posts: 14
Joined: Fri May 18, 2007 12:09 am
Contact:

Post by diegomazala »

Ok, but it's not works :(

I built a torus in 3d max and made 120 frames for animation.
I used Panda_Plugin to export .x file.
But...

Look my code

Code: Select all

irr::scene::IAnimatedMeshSceneNode* anms = smgr->addAnimatedMeshSceneNode(smgr->getMesh("../data/torus.x"));
if (anms)
{
	anms->setMaterialFlag(irr::video::EMF_LIGHTING, false);
	anms->setFrameLoop(0, 120);
	anms->setAnimationSpeed(40);
}
Do you have some .x file to test?

[/code]
Perceval
Posts: 158
Joined: Tue May 30, 2006 2:42 pm

Post by Perceval »

Take dwarf.x in the media directory.
diegomazala
Posts: 14
Joined: Fri May 18, 2007 12:09 am
Contact:

Post by diegomazala »

Yes,
with him works

So, it there some good .x exporter?
Or better, a converter 3ds to .x ?
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

I have the exact same problem. When I tried multiply everything with 100 I'v seen some animation but not the one I wanted.
I did it like this:

Code: Select all

irr::scene::IAnimatedMeshSceneNode* anms = smgr->addAnimatedMeshSceneNode(smgr->getMesh("my .x mesh"));
if (anms)
{
   anms->setMaterialFlag(irr::video::EMF_LIGHTING, false);
   anms->setFrameLoop(0*100, 120*100);
   anms->setAnimationSpeed(40*100);
} 
Edit: Got it fixed to run like in the tutorials without any *100.
The problem was that I didn't exported it right - I just changed the configurations in my exporter and it fixed it all.

Check this to see how to do it.
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Post Reply