0

I'm fairly new to threejs and am trying to create a moving skeleton with connected limbs. My question seems like something that I should have already found an answer for but I've been unsuccessful in my search, am I just using the wrong terms?

I am trying to move or rotate a child limb and have a parent "follow" it in rotation. The math to do this would be fairly complicated and I'm wondering if there's an automated way to do this. The code I have (mostly copied) successfully rotates a parent limb, which the child follows successfully, but I'm trying to do the opposite of this and move a child to have a parent follow.

I have documented my code on github (https://github.com/namgo/moveastickman), the main file in question is https://github.com/namgo/moveastickman/blob/master/public/script_bones.js which is based on https://github.com/kevanstannard/three-experiments/blob/master/src/experiments/skeleton-body/index.js

As you can see in the screenshots below, the parent does not move with the child in the right arm, but the children in the left arm and legs move with their parents. 45 deg and from the side

The solution provided at Three.JS - Child object rotation in it's place seems to just make the object flash around the screen, and also doesn't make the parent object move.

namgo
  • 11
  • 2
  • Questions seeking debugging help ("**why isn't this code working?**") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it **in the question itself**. Questions without **a clear problem statement** are not useful to other readers. See: [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – icecub May 13 '18 at 04:34
  • The technical term you seem to be looking for is *Inverse Kinematics*. It is far more complicated than applying the simple reverse of Three's (standard) parent-child relationships. I don't say this to dishearten you, it's just good to be aware when you are researching something more complex than it would seem at first sight. See https://stackoverflow.com/questions/14421031/inverse-kinematic-animation for some additional three.js-related resources. – Paul-Jan May 13 '18 at 05:57

0 Answers0