Jump to content

Move bones picked


Dad72
 Share

Recommended Posts

Hello,

I do not know if this is possible, but I wish move, for example, the arm of a character by selecting the bones of the hand and moving it with a gizmo (as does 3ds max or Blender)

Is it possible ? I fear that this is complicated, but maybe someone has ideas or alternative.

Thanks for help

Link to comment
Share on other sites

1. use bone.getAbsoluteTransform to get the World Matrix of each bone and use Matrix.decompose to get the rotation, position, scale of each of those bone matrices so that you can place the bone meshes you will be clicking and rotating.

2. after rotating one of your bone meshes, get the world matrix of that mesh and multiply it by the inverted absoluteTransform of the parent of the bone you are rotating.  Use the result to set the localMatrix of the actual bone you are rotating.

3. now you will need to update the absoluteTransform of the bone you just rotated and all of its children.  There is a function for that in the SkeletonViewer class.  Do step 1 again for the children of the bone you rotated.

 

Link to comment
Share on other sites

Thank you Adam, it helps me to understand. This sounds complex, I do not know if I'm going to me venture in there. I think I'll forget this possibility in my program. I have another alternative.

Eboo, this does not not much help, but thank you for trying. :)

Link to comment
Share on other sites

Quote

but I wish move, for example, the arm of a character by selecting the bones of the hand and moving it with a gizmo (as does 3ds max or Blender)

Dad 72, when I first saw this thread, I thought this could be interesting :)

What you are describing seems to be what I would call "Inverse Kinematics (IK)". If it is, it is not about just transforming/rotating one  bone but a chain of bones. The hand bone is moved but so are the lower arm and upper arm bones ( in a very simple case of a chain). So how are the new positions of these latter two bones  calculated? That calculation has to be included too - as well as somehow defining what bones would be in the chain.

Adam has perhaps just started to describe the complexity. And as you say, "This sounds complex:o

cheers, gryff :)

Link to comment
Share on other sites

Hi guys!  Yuh, been there... thought about that... twice.  :)

If a guy were to think about my buddy Bob's Big Fat Slow-Loading Drone demo, (in a perfect world)... we would want the up-force applyImpulse to happen AT each propeller blade. Then...

- the propeller blades lift the propeller mount/shaft
- the shaft lifts the motor body
- the motor body lifts the end of the drone arm
- the arm lifts the drone frame
- the drone frame lifts the payload

Yuh, not so easy.  :)

The same happened with that damned flying bed-frame demo of mine.  I wanted to apply thruster force AT each thruster port, then have that force transfer through the bed frame post, and thus contribute to lifting the "deck" where users parent-on their Winnebago campers.  ;)  Not gonna do.  OR... maybe.  What is a physics "link"?  hmm.  Two "joints" attached together, with spring-tension and axial limiters.  hmm.  How boney!

Most physics links I've seen... are stretchy and rubbery.  I don't trust them to "be there" when the going gets tough.  heh  The flying bed-frame applies all its forces... on a central invisible box/gizmo.  No force applied at point of thrust.  :(  Break-off a bed post in an accident, the bed frame still flies fine.  Darn.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...