Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6140951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:11:00+00:00 2026-05-23T18:11:00+00:00

I wish to utilize bullet-physics or similar physical-engine to create a realistic skeleton simulation

  • 0

I wish to utilize bullet-physics or similar physical-engine to create a realistic skeleton simulation of human-like body with two legs. That is, create a simulation of “a body” made of round mass on top of two “legs”, where each leg is made of 3 solid pieces connected through 3 joints and each joint have some degrees of freedom and a limited movement range in each direction, similar to human hip, knee and ankle.

I aim for a realistic model, and hence it will ‘stand’ only if all joints are balanced correctly and it will fall otherwise.

Any directions, suggestion or pointers to existing tutorials or resources is appreciated! This looks like an awful lot of work doing from scratch…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:11:01+00:00Added an answer on May 23, 2026 at 6:11 pm

    I’m working on similar code at the moment. My approach is use the Bullet Physics Rag Doll Demo as a starting point. It has a rag doll with body parts connected by joints.

    I’m then using the Bullet Physics Dynamic Control Demo to learn to bend the joints. The challenging part at the moment is setting all the parameters.

    I suggest you learn how to create two rigid bodies connected by a constraint and then to activate the constraint motor to bend the joint.

    The following is some code that I’m working with to learn how rigid bodies and constraints work in Bullet Physics. The code creates two blocks connected by a hinge constraint. The update function bends the hinge constraint slowly over time.

    Now that I’ve got this I’ll be going back to the Rag Doll and adjusting the joints.

    class Simple
    {
    private:
        btScalar targetAngle;
    
        btCollisionShape* alphaCollisionShape;
        btCollisionShape* bravoCollisionShape;
        btRigidBody* alphaRigidBody;
        btRigidBody* bravoRigidBody;
        btHingeConstraint* hingeConstraint;
    
        btDynamicsWorld* dynamicsWorld;
    
    public:
        ~Simple( void )
        {
        }
    
        btRigidBody* createRigidBody( btCollisionShape* collisionShape, 
                      btScalar mass, 
                      const btTransform& transform ) const
        {
        // calculate inertia
        btVector3 localInertia( 0.0f, 0.0f, 0.0f );
        collisionShape->calculateLocalInertia( mass, localInertia );    
    
        // create motion state
        btDefaultMotionState* defaultMotionState 
            = new btDefaultMotionState( transform );
    
        // create rigid body
        btRigidBody::btRigidBodyConstructionInfo rigidBodyConstructionInfo( 
            mass, defaultMotionState, collisionShape, localInertia );
        btRigidBody* rigidBody = new btRigidBody( rigidBodyConstructionInfo );      
    
        return rigidBody;
        }
    
        void Init( btDynamicsWorld* dynamicsWorld )
        {
        this->targetAngle = 0.0f;
    
        this->dynamicsWorld = dynamicsWorld;
    
        // create collision shapes
        const btVector3 alphaBoxHalfExtents( 0.5f, 0.5f, 0.5f );
        alphaCollisionShape = new btBoxShape( alphaBoxHalfExtents );
    
        //
        const btVector3 bravoBoxHalfExtents( 0.5f, 0.5f, 0.5f );
        bravoCollisionShape = new btBoxShape( bravoBoxHalfExtents );
    
        // create alpha rigid body
        const btScalar alphaMass = 10.0f;
        btTransform alphaTransform;
        alphaTransform.setIdentity();
        const btVector3 alphaOrigin( 54.0f, 0.5f, 50.0f );  
        alphaTransform.setOrigin( alphaOrigin );
        alphaRigidBody = createRigidBody( alphaCollisionShape, alphaMass, alphaTransform );
        dynamicsWorld->addRigidBody( alphaRigidBody );
    
        // create bravo rigid body
        const btScalar bravoMass = 1.0f;
        btTransform bravoTransform;
        bravoTransform.setIdentity();
        const btVector3 bravoOrigin( 56.0f, 0.5f, 50.0f );  
        bravoTransform.setOrigin( bravoOrigin );
        bravoRigidBody = createRigidBody( bravoCollisionShape, bravoMass, bravoTransform );
        dynamicsWorld->addRigidBody( bravoRigidBody );
    
        // create a constraint
        const btVector3 pivotInA( 1.0f, 0.0f, 0.0f );   
        const btVector3 pivotInB( -1.0f, 0.0f, 0.0f );
        btVector3 axisInA( 0.0f, 1.0f, 0.0f );
        btVector3 axisInB( 0.0f, 1.0f, 0.0f );
        bool useReferenceFrameA = false;
        hingeConstraint = new btHingeConstraint( 
            *alphaRigidBody,
            *bravoRigidBody,
            pivotInA,
            pivotInB,
            axisInA,
            axisInB,
            useReferenceFrameA );
    
        // set constraint limit
        const btScalar low = -M_PI;
        const btScalar high = M_PI;
        hingeConstraint->setLimit( low, high );
    
        // add constraint to the world
        const bool isDisableCollisionsBetweenLinkedBodies = false;
        dynamicsWorld->addConstraint( hingeConstraint, 
                          isDisableCollisionsBetweenLinkedBodies );
        }
    
        void Update( float deltaTime )
        {
        alphaRigidBody->activate();
        bravoRigidBody->activate();
    
        bool isEnableMotor = true;
        btScalar maxMotorImpulse = 1.0f; // 1.0f / 8.0f is about the minimum
    
        hingeConstraint->enableMotor( isEnableMotor );
        hingeConstraint->setMaxMotorImpulse( maxMotorImpulse );
    
        targetAngle += 0.1f * deltaTime;
        hingeConstraint->setMotorTarget( targetAngle, deltaTime );  
        }
    
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wish to create json looking like: {man: { name:emil, username:emil111, age:111 } }
I wish to select two distinct columns and one normal. But it seems like
I wish to know all the pros and cons about using these two methods.
I wish to remove from html things like <!--[if gte mso 9]> ... <![endif]-->
I wish to do something like this: return RedirectToAction<SomeController>(c => Index(someparameter)); How to do
I wish to utilize the new gated check-in function of TFS 2010. I have
I wish to use Google custom search and in particular would like to have
I have started learning Data Mining and wish to create a small project in
I wish Subversion had a better way of moving tags. The only way that
I wish to implement a 2d bit map class in Python. The class would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.