Bug 398 - Nlerp fallback problem where applying slerp to opposed quaternions
: Nlerp fallback problem where applying slerp to opposed quaternions
Status: RESOLVED FIXED
Product: Eigen
Classification: Unclassified
Component: Geometry
: unspecified
: All All
: Normal normal
Assigned To: Nobody
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2011-12-23 09:36 UTC by Mathieu Joubert
Modified: 2011-12-23 22:46 UTC (History)
3 users (show)



Attachments
Test case (521 bytes, application/octet-stream)
2011-12-23 09:36 UTC, Mathieu Joubert
no flags Details

Description Mathieu Joubert 2011-12-23 09:36:50 UTC
Created attachment 242 [details]
Test case

In Quaternion.h, using slerp with two quaternions which are opposed (i.e.
a,b,c,d and -a,-b,-c,-d) result in an incorrect nlerp interpolation.

(a,b,c,d) and (-a,-b,-c,-d) represent the same rotation and thier scalar
product is one. This results in nlerp fallback but this interpolation cannot be
done without inverting scale 0 or scale 1.

I think the solution is to put the (d<0) test out of the else statement so it
applies to all angles. Puting the line 706 ( "}" )in place on the line 704
solved this issue for me.

Mathieu
Comment 1 Gael Guennebaud 2011-12-23 22:40:35 UTC
thanks for the report,

https://bitbucket.org/eigen/eigen/changeset/cca1df640bd5/
changeset:   cca1df640bd5
date:        2011-12-23 22:39:32
summary:     fix bug 398, the quaternion returned by slerp was not always
normalized,
add a proper unit test for slerp
Comment 2 Gael Guennebaud 2011-12-23 22:46:12 UTC
https://bitbucket.org/eigen/eigen/changeset/7a3491a304e4/
changeset:   7a3491a304e4
branch:      3.0
user:        ggael
date:        2011-12-23 22:39:32
summary:     fix bug 398, the quaternion returned by slerp was not always
normalized,
add a proper unit test for slerp
(transplanted from cca1df640bd516e4a7dd0761695e05f4eababe00)

Note You need to log in before you can comment on or make changes to this bug.