problem about x file of 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.
klikli234
Posts: 97
Joined: Tue Sep 07, 2010 10:52 am

problem about x file of animation

Post by klikli234 »

How to make the mesh upper body play an animation at the same time lower-body play another animation?
thx.
CuteAlien
Admin
Posts: 10041
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

You would have to use 2 different scenenodes. In most cases the best solution is to make just more animations so you have one animation for all combinations. This also results generally in better animations (motions usually affect the whole body).
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
klikli234
Posts: 97
Joined: Tue Sep 07, 2010 10:52 am

Post by klikli234 »

CuteAlien wrote:You would have to use 2 different scenenodes. In most cases the best solution is to make just more animations so you have one animation for all combinations. This also results generally in better animations (motions usually affect the whole body).
thanks!
2 different scenenodes, I can't understand.
now I have mesh lower-body is run animation. upper body sometime need reload animation,sometime need shooting animation at the same time lower body keep play run animation.
Key is upper body have shooting angle.
Will that do?
klikli234
Posts: 97
Joined: Tue Sep 07, 2010 10:52 am

Post by klikli234 »

can anyone help me.


Animation blending (ability to play multiple animation loops at the same time, with a weighting between them)

Animation Blending in program
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

The way I did this was by casting the meshes with animations in them to CSkinnedMesh, then did the blending manually. You have to change the joint control mode for the mesh you're animating, and set the bone positions manually as the blended position from the CSkinnedMesh-es. Worked fine for me, and there wasn't too much of a slow down.
klikli234
Posts: 97
Joined: Tue Sep 07, 2010 10:52 am

Post by klikli234 »

Lonesome Ducky wrote:The way I did this was by casting the meshes with animations in them to CSkinnedMesh, then did the blending manually. You have to change the joint control mode for the mesh you're animating, and set the bone positions manually as the blended position from the CSkinnedMesh-es. Worked fine for me, and there wasn't too much of a slow down.
thx,I'm a beginner. I point don't understand
Can write a simple example.
Key code section, order
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

klikli234 wrote:thx,I'm a beginner. I point don't understand
This is no excuse. Its like someone who has never build even an outhouse to start building skyscrapers. Beginners should read lots of tutorials, examples etc. and start with more basic stuff. What you wanna do is a bit more for your current skill level. I advise you to work on the easier parts of your project, then soon you`ll get some experience and be able to move to the more advanced stuff.
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
klikli234
Posts: 97
Joined: Tue Sep 07, 2010 10:52 am

Post by klikli234 »

shadowslair wrote:
klikli234 wrote:thx,I'm a beginner. I point don't understand
This is no excuse. Its like someone who has never build even an outhouse to start building skyscrapers. Beginners should read lots of tutorials, examples etc. and start with more basic stuff. What you wanna do is a bit more for your current skill level. I advise you to work on the easier parts of your project, then soon you`ll get some experience and be able to move to the more advanced stuff.
thanks,very much
klikli234
Posts: 97
Joined: Tue Sep 07, 2010 10:52 am

Post by klikli234 »

shadowslair wrote:
klikli234 wrote:thx,I'm a beginner. I point don't understand
This is no excuse. Its like someone who has never build even an outhouse to start building skyscrapers. Beginners should read lots of tutorials, examples etc. and start with more basic stuff. What you wanna do is a bit more for your current skill level. I advise you to work on the easier parts of your project, then soon you`ll get some experience and be able to move to the more advanced stuff.
Excuse me,I find very long did not find tutorial
I had the same problem with him.
http://irrlicht.sourceforge.net/phpBB2/ ... kinnedmesh


I hope you can give me the tutoria link, or name

Very thank you very much
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

You can't expect there to be a tutorial for every single problem you're having, what shadowslair meant is that you should read more tutorials about animations, 3D programming and irrlicht so you can solve problems yourself

Thinking and solving problems on your own is not illegal in programming you know ;)
klikli234
Posts: 97
Joined: Tue Sep 07, 2010 10:52 am

Post by klikli234 »

Radikalizm wrote:You can't expect there to be a tutorial for every single problem you're having, what shadowslair meant is that you should read more tutorials about animations, 3D programming and irrlicht so you can solve problems yourself

Thinking and solving problems on your own is not illegal in programming you know ;)
thx.
I only need example is introduced in ISkinnedMesh usage, document many look not to understand.
My English is very poor, I am using translation software, and before the search keyword all don't know how to write

I think I know how to do it. Put a animation bone into another model skeleton, will there be?
klikli234
Posts: 97
Joined: Tue Sep 07, 2010 10:52 am

Post by klikli234 »

I really can't find tutorial for my problem.
I found several topics are said solve with cskinnedmesh

I try to use 2 node, but there are 2 mesh in my scene.

Code: Select all

	scene::IAnimatedMeshSceneNode* node = 0;

	node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("player/urban-6.x"),0);
	node->setPosition(core::vector3df(0,36.f,0)); // Put its feet on the floor.
	node->setRotation(core::vector3df(0,-90.f,0)); // And turn it towards the camera.
	node->setMaterialFlag(EMF_LIGHTING, false);
	node->setAnimationSpeed(30.f);
	node->setFrameLoop(46,81);
	node->setCurrentFrame(0.f);
	node->setLoopMode(true);

	//隐藏节点
	scene::IAnimatedMeshSceneNode* node2 = 0;
	scene::ISkinnedMesh* hidenode = (scene::ISkinnedMesh*)node->getMesh();
	hidenode->useAnimationFrom(hidenode);
	node2 = smgr->addAnimatedMeshSceneNode(hidenode,0);
	node2->setMaterialFlag(EMF_LIGHTING, false);
	node2->setAnimationSpeed(30.f);
	node2->setFrameLoop(0,45);
	node2->setCurrentFrame(10.0f);
	node2->setLoopMode(true);
Please help me, please
CuteAlien
Admin
Posts: 10041
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

klikli234 wrote:
CuteAlien wrote:You would have to use 2 different scenenodes. In most cases the best solution is to make just more animations so you have one animation for all combinations. This also results generally in better animations (motions usually affect the whole body).
thanks!
2 different scenenodes, I can't understand.
now I have mesh lower-body is run animation. upper body sometime need reload animation,sometime need shooting animation at the same time lower body keep play run animation.
Key is upper body have shooting angle.
Will that do?
What I mean is that you could just use full-body animations for each state. Like "running while looking straight forward" and "running while looking left". Animation data is not using much memory and it's easier to do that stuff in a modeling tool anyway instead of trying to code it. This will get you good results and is done like that in a lot of games.

Everything else is complicated and I don't think you can easily do that if you're not really understanding how animation systems do work.
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
klikli234
Posts: 97
Joined: Tue Sep 07, 2010 10:52 am

Post by klikli234 »

CuteAlien wrote: What I mean is that you could just use full-body animations for each state. Like "running while looking straight forward" and "running while looking left". Animation data is not using much memory and it's easier to do that stuff in a modeling tool anyway instead of trying to code it. This will get you good results and is done like that in a lot of games.

Everything else is complicated and I don't think you can easily do that if you're not really understanding how animation systems do work.
I kown something

Code: Select all

	node = smgr->addAnimatedMeshSceneNode(smgr->getMesh("player/urban-6.x"),0);
	node->setPosition(core::vector3df(0,36.f,0)); // Put its feet on the floor.
	node->setRotation(core::vector3df(0,-90.f,0)); // And turn it towards the camera.
	node->setMaterialFlag(EMF_LIGHTING, false);
	node->setAnimationSpeed(30.f);
	node->setFrameLoop(46,81); // reload
	node->setCurrentFrame(0.f);
	node->setLoopMode(true);

	//隐藏节点
	scene::IAnimatedMeshSceneNode* node2 = 0;
	scene::ISkinnedMesh* hidenode = (scene::ISkinnedMesh*)node->getMesh();
	node2 = smgr->addAnimatedMeshSceneNode(hidenode,0);
	node2->setMaterialFlag(EMF_LIGHTING, false);
	node2->setFrameLoop(0,45); walk
	node2->setLoopMode(true);

	//骨头节点 Bip01 Spine3
	node->setJointMode( irr::scene::EJUOR_CONTROL);
	node2->setJointMode( irr::scene::EJUOR_CONTROL);
	
	
	IBoneSceneNode* bonenode1 = node->getJointNode((irr::c8*)"Bip01_Spine");
	IBoneSceneNode* bonenode2 = node->getJointNode((irr::c8*)"Bip01_Spine3");
	IBoneSceneNode* bonenode3 = node->getJointNode((irr::c8*)"Bip01_Neck");

	IBoneSceneNode* bonenode4 = node2->getJointNode((irr::c8*)"Bip01_Spine");

			core::vector3df camrota = camera2->getRotation();
			camrota.X = 0.f;
			//camrota.Y = 0.f;
			//camrota.Z = 0.f;
			core::vector3df rotaa = matrixRotation(bonenode2->getRotation(),camrota);
			bonenode2->setRotation(core::vector3df(camrota.Y,0.f,0.f));

			bonenode4->setRotation(bonenode2->getRotation());

I can get node2's walk joint ratation and position's value set to node.
but there do it without ISkinnedMesh.
How do I will animation store to ISkinnedMesh instead of node2
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Post by mongoose7 »

I think you need

bonenode1->UseAnimationFrom = bonenode2;

Then bonenode1 will have the animation of bonenode2.
Post Reply