Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotation axis #198

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Rotation axis #198

wants to merge 7 commits into from

Conversation

pehrlich
Copy link
Contributor

WIP - this still needs to be confirmed, and the tests updated to match. CC @GabrielHare

@pehrlich
Copy link
Contributor Author

cross reference: #191

@GabrielHare
Copy link

I’ll take a look tomorrow. Bug me about it please? ;-)

On 13 Nov, 2014, at 7:41 PM, Peter Ehrlich notifications@github.com wrote:

cross reference: #191 #191

Reply to this email directly or view it on GitHub #198 (comment).

NOTE: The information in this message and any attachments is confidential
information intended only for the individual to whom it is addressed. If
you are not the intended recipient, any distribution of this message or its
attachments is prohibited. If you have received this email in error,
please immediately notify us and delete the message. Thank you.

var cs = (rot[0] + rot[4] + rot[8] - 1.0)*0.5;
var angle = Math.acos(cs);
angle = isNaN(angle) ? 0.0 : angle;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A reasonably clear derivation can be found here: http://en.wikipedia.org/wiki/Axis–angle_representation#Exponential_map_from_so.283.29_to_SO.283.29

Also see the log map section.

Gabriel Hare and others added 4 commits November 17, 2014 13:07
PROBLEM: The output of rotationAxis is normalized
var sin = Leap.vec3.len(this.rotationAxis(sinceFrame));

This has been addressed by re-deriving the axis of rotation without  normalization.

NOTE: The equations used here (which match those used in platform) will result in an undefined rotation at 180 deg. The formula used here conforms to the Leap math standards.
Making hand rotationAngle consistent with frame rotationAngle
Correcting variable name rotation -> rot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants