This is an extension of the Bullet appGenericJointDemo (the ragdoll demo that uses btGeneric6DofConstraints as joints).
The joints are animated by applying motors to the constraint axis (thus the animations aren't "quaternion" based, but just "Euler" based) like in the Bullet appForkliftDemo and appDynamicControlDemo (also known as appMotorDemo: the "mechanized spider" demo).
IMPORTANT: This is not intended to be an optimal solution; it's just a starting point that can be used by developers who want to implement something similiar from scratch.
Screenshot:Source code + precompiled binary for Win32 (compiled with Visual C++ 2008 and /MD, Visual C++ 2008 Redistributable Package required):
appAnimatedGenericJointDemo
-
- Posts: 456
- Joined: Tue Dec 25, 2007 1:06 pm
appAnimatedGenericJointDemo
You do not have the required permissions to view the files attached to this post.
-
- Posts: 6
- Joined: Wed Dec 11, 2013 9:27 am
Re: appAnimatedGenericJointDemo
hi Flix,
I have gone through your code of Ragdoll adn addition of custom animation to it. I have some doubts can you please clear it.
1) why did you set the augular factor of pelvis bone in Y direction and how it counters the gravity and stands up. Can you suggest any other way to do it.
// Prevent ragdoll from falling (most people won't like it)
m_bodies[BODYPART_PELVIS]->GetRigidBody()->setAngularFactor(btVector3(0,1,0));
2) If I want to create an animation from the data file having some rotations to some particular bone.
my preliminary thought is to create a btAnimation variable and based on the bone name we add the keyframes to that variable till that point is ok how to play this animation at the same time i.e the adding keyframes and the animation should happen at same time. here I am facing issue. please suggest something.
I have gone through your code of Ragdoll adn addition of custom animation to it. I have some doubts can you please clear it.
1) why did you set the augular factor of pelvis bone in Y direction and how it counters the gravity and stands up. Can you suggest any other way to do it.
// Prevent ragdoll from falling (most people won't like it)
m_bodies[BODYPART_PELVIS]->GetRigidBody()->setAngularFactor(btVector3(0,1,0));
2) If I want to create an animation from the data file having some rotations to some particular bone.
my preliminary thought is to create a btAnimation variable and based on the bone name we add the keyframes to that variable till that point is ok how to play this animation at the same time i.e the adding keyframes and the animation should happen at same time. here I am facing issue. please suggest something.
-
- Posts: 456
- Joined: Tue Dec 25, 2007 1:06 pm
Re: appAnimatedGenericJointDemo
Because otherwise the character will fall. Another approach might be using a world-space btGenericDof6Constraint that keeps the character up.srikrishna3118 wrote:1) why did you set the augular factor of pelvis bone in Y direction and how it counters the gravity and stands up. Can you suggest any other way to do it.
Well, it you mean you want to "merge" a piece of animation with another, I didn't get that far: the only thing I can think is just to make a whole new animation from scratch.srikrishna3118 wrote:2) If I want to create an animation from the data file having some rotations to some particular bone.
my preliminary thought is to create a btAnimation variable and based on the bone name we add the keyframes to that variable till that point is ok how to play this animation at the same time i.e the adding keyframes and the animation should happen at same time. here I am facing issue. please suggest something.
As I have clearly stated in my first post:
This is not intended to be an optimal solution; it's just a starting point that can be used by developers who want to implement something similiar from scratch.
-
- Posts: 29
- Joined: Sat May 18, 2013 1:36 am
- Location: NY
Re: appAnimatedGenericJointDemo
Thanks for contributing this demo I am going to try to develop off of it.
Did you get the idea from here?
http://animation.comp.nus.edu.sg/locotest.html
Is btAnimation in the bullet libs?
If so where?
edit: I Found btAnimation, I had assumed it was in bullet
Did you get the idea from here?
http://animation.comp.nus.edu.sg/locotest.html
Is btAnimation in the bullet libs?
If so where?
edit: I Found btAnimation, I had assumed it was in bullet

Last edited by StabInTheDark on Sat Jan 25, 2014 5:17 pm, edited 1 time in total.
-
- Posts: 456
- Joined: Tue Dec 25, 2007 1:06 pm
Re: appAnimatedGenericJointDemo
I posted this demo on Fri Feb 10, 2012, so this stuff is nearly 2 years old. I've never seen that link (although it seems to be older than mine).StabInTheDark wrote:Did you get the idea from here?
Nope, it's in the code of the demo.StabInTheDark wrote:Is btAnimation in the bullet libs?
-
- Posts: 6
- Joined: Wed Dec 11, 2013 9:27 am
Re: appAnimatedGenericJointDemo
1) Can you please explain how it prevents the character from falling.Because otherwise the character will fall. Another approach might be using a world-space btGenericDof6Constraint that keeps the character up.
2) Can you please eloborate the another approach of using world space in btGenericDof6Constraint.
I will eloborate my project since i am working in a company i couldn't share my work with you.Well, it you mean you want to "merge" a piece of animation with another, I didn't get that far: the only thing I can think is just to make a whole new animation from scratch.
1) I am using Assimp library for rendering the model animation.
2) Then I have added physics based skeleton to that model and using your idea I could make the model stand thanks for that.
3) Now I have to synchronise bullet world transformation with the model i am using and secondly I will get data from mocap sensors from socket and I need to feed that data to the physics world and after that I need to check the working in the model i rendered using assimp library.
I am actually struck near synchronization and real time animation. can you suggest any ideas how to proceed.
when I gave the translation and rotation information of the bullet skeleton from the ragdoll to certain bones in the assimp based rendered model following results are seen i have attached a vedio.
You do not have the required permissions to view the files attached to this post.
-
- Posts: 456
- Joined: Tue Dec 25, 2007 1:06 pm
Re: appAnimatedGenericJointDemo
By keeping the "pelvis" rigid body vertical all the time.srikrishna3118 wrote:1) Can you please explain how it prevents the character from falling.
A btGenericDof6Constraint between the world and the "pelvis" rigid body can be used to replace the angular factor: the only advantage one can have is that it's possible "lock" the vertical axis while the character is moving. I had a functional demo modification about it, but I've lost it with my whole WindowsXP partition about a year ago, so I cannot share it. However there are some old posts in which I think I've explained this approach better: http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=8153 and http://bulletphysics.org/Bullet/phpBB3/ ... its#p27180. But honestly I don't know know if it's worth doing the change just to have the very tiny advantage I've described above.srikrishna3118 wrote:2) Can you please eloborate the another approach of using world space in btGenericDof6Constraint.
I don't think that what you're trying to achieve is possible. The assimp imported skeleton is not made by rotations only, but by translations too and sometimes that's an offset (transform) between a bone and its child bones. Moreover that are maybe 6 different ways in which a btQuaternion/btMatrix3x3 can be converted to a set of 3 Euler angles. I guess it would be extremely difficult to port the Bullet world transforms to the corresponding assimp world (or local) transforms of the bones, and much more difficult it should be to take the opposite path.srikrishna3118 wrote:3) Now I have to synchronise bullet world transformation with the model i am using and secondly I will get data from mocap sensors from socket and I need to feed that data to the physics world and after that I need to check the working in the model i rendered using assimp library.
In short: I have no idea on how you can do it and I've never tried or managed to do that myself. So I can't help you with that

P.S. Please remember that this demo is 2 years old, and probably now it should be worth using the Bullet Featherstone multibody support to do stuff related to ragdoll/skeletal animations.
-
- Posts: 6
- Joined: Wed Dec 11, 2013 9:27 am
Re: appAnimatedGenericJointDemo
thanks for your time and suggestion. I will try it.
-
- Posts: 6
- Joined: Wed Dec 11, 2013 9:27 am
Re: appAnimatedGenericJointDemo
hi Flix,
I could partially suceed in the goal of synchronizing bullet skeleton and the collada model using assimp library.
There is a small glitch in the beginning of synchronization. upper half has some problems though
If you could add some thing please let me know. I am now working on the upper half of the body.
Thanks for your time.
I could partially suceed in the goal of synchronizing bullet skeleton and the collada model using assimp library.
Thanks for your sugestion actually i missed that point. Now for lower half of the body I could assign the rotations perfectly synchronized. you can see in the vedioThe assimp imported skeleton is not made by rotations only, but by translations too and sometimes that's an offset (transform) between a bone and its child bones.
There is a small glitch in the beginning of synchronization. upper half has some problems though
If you could add some thing please let me know. I am now working on the upper half of the body.
Thanks for your time.
You do not have the required permissions to view the files attached to this post.