www.jpct.net

Bones - Skeletal and Pose Animations for jPCT/jPCT-AE => Bones => Topic started by: dcfingerprint on December 08, 2016, 10:18:51 pm

Title: Positioning and orienting Object3D with a Bones joint?
Post by: dcfingerprint on December 08, 2016, 10:18:51 pm
Hi,

I'm interested in dynamically adding an Object3D to the world and positioning/orienting it relative to a particular Bones Joint in an Animated3D.   

For example - to place an dynamically created object in the hand of a model, and keeping it aligned with the hand as it moves/rotates.  (Or a hat on the head of a model, which will stay on the head, regardless of how the model animates.) 

Any tips for getting the position and rotation to use with either Object3D.setTranslationMatrix(), setRotationMatrix(), or using Object3D.translate(x,y,z) / rotateX(), rotateY(), rotateZ() / rotateAxis() ? 

The Object3D to "attach" could either be a sibling of the Animated3D root, or a child.

Any code samples would be appreciated.  Thanks!
Title: Re: Positioning and orienting Object3D with a Bones joint?
Post by: raft on December 09, 2016, 12:12:12 am
have a look at source code of SkeletonDebugger, it does sth similar to your case, positions "joint" and "bone" objects according to where joint actually is.