jsantell / THREE.IK

inverse kinematics for three.js
https://jsantell.github.io/THREE.IK
MIT License
455 stars 54 forks source link

Explanation of API and non Node.js version of THREE.IK #14

Closed WolfgangFahl closed 5 years ago

WolfgangFahl commented 5 years ago

I am trying to get https://stackoverflow.com/questions/57311356/rotating-an-object-properly-around-a-pivot-point-given-axis-and-angle/57312831#57312831 resolved and would love to use THREE.IK for this.

Even after spending many days in analyzing how Three.js works i don't have a firm grip on how it works. I'd like to apply it to http://pi-q-robot.bitplan.com/ see https://github.com/BITPlan/PI-Q-Robot/blob/master/web/js/robot.js

I'd need to link Robot, Part and Childpart to the corresponding IK concepts. Todo so I'd need to know which API parts are relevant.

Since I am not using node.js I'd also need a none Node.js version of THREE.IK. Would it be sufficient to get rid of the import statements and use fully qualified references instead?

jsantell commented 5 years ago

Hi @WolfgangFahl! There is a UMD build at build/three-ik.js that will work in both the browser and commonJS (node) environments. In the browser, window.THREE must be provided, and similarly in node, require('three') must be resolvable. The examples are probably a good place to start

WolfgangFahl commented 5 years ago

@jsantell Jordan - thank you for looking into this. I'd love to use the UMD build if i'd simply understand the structure. The examples nicely show the behavior of the code. They do not explain the structure, API and design decisions. https://github.com/jsantell/THREE.IK/blob/master/examples/demo.js and https://github.com/jsantell/THREE.IK/blob/master/examples/scripts/IKApp.js e.g. at this point do not have a single line of comment and the content is greek to me. I can't find out where the parts (bones) are created, positioned, rotated and connected and what the api for that is.

jsantell commented 5 years ago

The readme has links to API docs, noting design decisions are listed in the issues as points of discussion -- Discover three.js or Learning three.js are good resources to learn more about three.js to better understand how everything works. Good luck!