Dad72 Posted May 6, 2016 Share Posted May 6, 2016 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 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 6, 2016 Share Posted May 6, 2016 it is possible in ShaderBuilder i can make sample if you agree but it is not have bones Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 6, 2016 Author Share Posted May 6, 2016 I must be able to manipulate the bones. So shaderBuilder not help me. but thanks. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 6, 2016 Share Posted May 6, 2016 in shader builder you can detect picked object part? it can be help? you need make texture with color and replace color by Id (with special pic ) you can detect your picked id Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 6, 2016 Author Share Posted May 6, 2016 I do not want to use ShaderBuilder that seems too complicated. I would select with scene.pick a bone and able to handle it with Babylon. But I do not know how. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted May 6, 2016 Share Posted May 6, 2016 This is possible but not simple. The bone is only represented by a matrix. So this will require some updates in the picking system first Then moving it is easy has you jsut need to change its matrix Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 7, 2016 Author Share Posted May 7, 2016 Yeah, I'm not sure I understand. the matrix, I still trouble understanding his cattle there. Are there examples of the use of matrix? Quote Link to comment Share on other sites More sharing options...
eboo Posted May 7, 2016 Share Posted May 7, 2016 yes ! ok je sort! Wingnut and NasimiAsl 2 Quote Link to comment Share on other sites More sharing options...
jerome Posted May 7, 2016 Share Posted May 7, 2016 :-D NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
adam Posted May 7, 2016 Share Posted May 7, 2016 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. NasimiAsl, gryff and Dad72 3 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 7, 2016 Author Share Posted May 7, 2016 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. gryff 1 Quote Link to comment Share on other sites More sharing options...
gryff Posted May 7, 2016 Share Posted May 7, 2016 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" cheers, gryff Quote Link to comment Share on other sites More sharing options...
Dad72 Posted May 7, 2016 Author Share Posted May 7, 2016 This is exactly what I wanted to do 'inverse kinematics'. But I am not going to succeed in making it. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted May 8, 2016 Share Posted May 8, 2016 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.