skeletal human animations [UPDATED]

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
xray
Posts: 231
Joined: Fri Feb 02, 2007 1:06 pm
Location: Germany, Munich
Contact:

Post by xray »

Thanks!

Sure its not frame independent, but this is something what you have to do by your own. It is just an example how to implement the skeleton class. It is also not clever to implement frame independent animation into the skeleton class.

And more animations would be fine, thats right. But i also have to code on my game project, so there isnt so much time :)
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Very Nice Xray! I've downloaded and checked your demo.

We will still need to rig the character with the bones and set the vertex map?
That's why you included a .blend version so others could take the bones and put it on their characters?
xray
Posts: 231
Joined: Fri Feb 02, 2007 1:06 pm
Location: Germany, Munich
Contact:

Post by xray »

Exactly christian!

You only have to create your model, apply bones (with the correct names , or modify the bone names in my skeleton class) and load the mesh. Or you just use my .blend character, its free to use if you mention me in your project!
dlangdev
Posts: 1324
Joined: Tue Aug 07, 2007 7:28 pm
Location: Beaverton OR
Contact:

Post by dlangdev »

Nice, I just downloaded the latest demo and it now has cool colors in there.

Thanks.
Image
doraemonalex
Posts: 4
Joined: Sun Jan 20, 2008 7:37 am

Post by doraemonalex »

Hi

As I want to use this model for my course work, I have tried to re-compile this with Visual Studio 2005. I can compile it, but when I tried to load it, it stops automatically. When I try to use debug mode, the program halts at this screen

http://www.hkbdc.org/fail.png

Could anyone please help me to figure out what's the problem ? I have tried on 2 different computers but the result is still the same ....

thanks :)
xray
Posts: 231
Joined: Fri Feb 02, 2007 1:06 pm
Location: Germany, Munich
Contact:

Post by xray »

Are you using an older version of irrlicht ?

Try to post your problem in Beginner or Advanced Section.
sp00n
Posts: 114
Joined: Wed Sep 13, 2006 9:39 am

Post by sp00n »

doraemonalex wrote:http://www.hkbdc.org/fail.png

Could anyone please help me to figure out what's the problem ? I have tried on 2 different computers but the result is still the same ....thanks :)
Are you using a software rendering? If yes try to switch to other rendering(DirectX ot OpenGL) and run an application. As i think it's a trouble with Burn's software rendering, when using an iarray types.
plotti
Posts: 21
Joined: Thu Oct 18, 2007 9:58 am

Post by plotti »

I'd like to put some textures on this doll, to make it look realistic. I guess by simply editing those colored imaged it will take me ages to find out a combitiation that works.

How do you change those textures in blender? Or what is the normal way how you would put some jeans and a sweater and a face on this guy?
________
Vapir No2
Last edited by plotti on Tue Feb 22, 2011 8:15 am, edited 1 time in total.
xray
Posts: 231
Joined: Fri Feb 02, 2007 1:06 pm
Location: Germany, Munich
Contact:

Post by xray »

The normal way is the way blender does. I dont want to explain a step by step texturing in here because it takes to long and there are other guys who still did this, so try out blender tutorials:

http://en.wikibooks.org/wiki/Blender_3D ... Links_List
crispweed
Posts: 1
Joined: Thu May 22, 2008 7:58 am

Post by crispweed »

doraemonalex wrote:When I try to use debug mode, the program halts at this screen

http://www.hkbdc.org/fail.png

Could anyone please help me to figure out what's the problem ? I have tried on 2 different computers but the result is still the same ....
Looks like the same issue as I saw.
This was an array index out of bounds error.
Change some array initialisations in Skeleton.cpp as follows:

Code: Select all

		for (int n=0; n<CSK_ANIM_COUNT; n++)
			startMode.push_back(true);
			
		for (int n=0; n<CSK_ANIM_COUNT; n++)
			normalise.push_back(false);
(i.e. 1 starting loop index is changed to 0 in both cases)
xray
Posts: 231
Joined: Fri Feb 02, 2007 1:06 pm
Location: Germany, Munich
Contact:

Post by xray »

Thanks! I will change it...
doqkhanh
Posts: 158
Joined: Sat Mar 01, 2008 3:14 am
Location: Tokyo, Japan
Contact:

Post by doqkhanh »

Is there any news about this wonderful attempt? :oops:
xray
Posts: 231
Joined: Fri Feb 02, 2007 1:06 pm
Location: Germany, Munich
Contact:

Post by xray »

Sorry doqkhanh, but I didnt started extending the animation class, because I dont need it at the moment... but the code should give you a detailed explanation how to enlarge the class with other animations. The only problem I see is, that for more complex and smooth animations it will be really hard get good results. Theoretically it should work, but if you want complex periodical animations, your functions getting very complex out of sinus and cosinus... I also thought about a better method, over motion capture with two webcams. Maybe I will try this solution if I get more time.
shadowslair
Posts: 758
Joined: Mon Mar 31, 2008 3:32 pm
Location: Bulgaria

Post by shadowslair »

Sorry doqkhanh, but I didnt started extending the animation class, because I dont need it at the moment... but the code should give you a detailed explanation how to enlarge the class with other animations. The only problem I see is, that for more complex and smooth animations it will be really hard get good results. Theoretically it should work, but if you want complex periodical animations, your functions getting very complex out of sinus and cosinus... I also thought about a better method, over motion capture with two webcams. Maybe I will try this solution if I get more time.
This was exactly what I wanted to ask. The non-closed-circle animations like putting a pistol out of a holster and pulling a switch will be kinda problematic. This may need some extra keyframe-array algorithm. I implemented your class in my project two days ago, but currently I`m in exam session in the university, so I`m in a lack of spare time. One of the things I spotted was that you`re not calling AnimateJoints(); anywhere. I was wondering how do you set those variables for the animations? You animate the dude in Blender, write down some intersting values and add them to the code, right?

I would be very thankful if you suggest me a way of exporting similar model from 3dmax8, since I have problems with Panda and kWexporter or sth alike. The first messes the rigging and the second misses the materials.

As far as I understand the principle of the example is that we set one value and use a variable, changing another one`s value in sinusoidal curve, causing the oscilation around the first value, right? If we change the animation we call sth like interpolation, where the stand animation is the default or "zero" animation. That`s fine, but if we wanna have a large variety of animations it will be harder to check if this then do that. What may be implemented is sth like a function for universal smoothing between the animations. Sth like:

Code: Select all

//in the beginning of animateskel();
if ( lastplayedanim!=currentanim && ready=0)  BlendAnimation();
Where BlendAnim() will get all the bone rotations from the last step and those for the current step and in some time ( 1sec for example) will manage to blend those rotations. This way the code will be better and we won`t have to go back to stand animation and interpolate to the next animation then.

Sorry if I had misunderstood sth, but I really took one really fast look at the code. I love it, since it gives me the freedom I needed, but as usual some things have to be improved to make it much better.

So keep it up, buddy! :wink:
"Although we walk on the ground and step in the mud... our dreams and endeavors reach the immense skies..."
xray
Posts: 231
Joined: Fri Feb 02, 2007 1:06 pm
Location: Germany, Munich
Contact:

Post by xray »

One of the things I spotted was that you`re not calling AnimateJoints(); anywhere. I was wondering how do you set those variables for the animations? You animate the dude in Blender, write down some intersting values and add them to the code, right?
Not exactly, if you look into skeleton.cpp and the method 'animSkeleton' at the end you will find this lines:

Code: Select all

	// apply all rotations to bones
	for (int n=0; n<SKT_BONE_COUNT; n++) {
		bones[n]->setRotation(matrixRotation(bonesRot[n], bonesOsci[n]));
		bones[n]->setPosition(bonesPos[n]+ bonesOsciPos[n]);
	}
...so bones are pointers of type scenenodes, and you know that you can set rotation and position to a scenenodes. The lines before are to calculate the current position and rotation for each bone. So I didnt do anything else in blender than modeling my character and the appropriate joints/bones to it without any animation or keyframes.
For the animations I just thought about which function could qualifies for example the rund circle out of sinus and cosinus...

For your export problem, I cant give you any advice how it should work in 3dsmax. Im a blender user and did it with a modified X exporter. So the only thing you could test is to go the way from 3dsmax over blender to X file format.
As far as I understand the principle of the example is that we set one value and use a variable, changing another one`s value in sinusoidal curve, causing the oscilation around the first value, right?
Yes, thats right! Your suggestion and example of a BlendAnimation function would make things alot easier to the users... but it should also be combined with a better method of creating animations. Like you said at the beginning it would be not really easy to create 'putting a pistol out...' circle. But the problem here lies not in the fact that it isnt a closed-circle, but in the fact that users need to know alot about functions. So your mathematical knowlege must be better than adequate. And if you want more complex anims like falling down/ dying you need complex functions.

cheers!
Post Reply