I'm working with a sensor to control the rotation of a hand model in THREE. I want to be able to apply an offset (on button click) to the hand model to adjust for any initial sensor position discrepancies.
I'm using quaternions and i'm not entirely clear on how to do this.
It seems that the approach should be to get the current position, get the difference between the current position and the home position [0,0,0,1], and apply this offset to the live sensor values.
I've tried this so far:
// on button click
quaternionOffset.copy(quaternion.multiplyQuaternions(quaternion.inverse(), startPosition))
// on update
quaternion.multiply(quaternionOffset)
initial sensor position (example)
home position (fingers pointing forward)
Thank you for the help