home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!hal.com!decwrl!concert!borg!debussy!taylorr
- From: taylorr@debussy.cs.unc.edu (Russell Taylor)
- Newsgroups: comp.graphics
- Subject: Re: Shoemake quaternion typos
- Message-ID: <14608@borg.cs.unc.edu>
- Date: 20 Aug 92 11:54:41 GMT
- References: <rd#n39#.spworley@netcom.com>
- Sender: news@cs.unc.edu
- Organization: The University of North Carolina at Chapel Hill
- Lines: 39
-
- In article <rd#n39#.spworley@netcom.com> spworley@netcom.com (Steven) writes:
- >Anyone know about any typos in this (key) document?
- >
- We found what I wouldn't call a typo, but is sometimes a problem to us:
- When doing a slerp, the code sometimes takes the "long way" around. In other
- words, when interpolating between two orientations there is an ambiguity
- about "which way around the Earth" to travel, and the code does not resolve
- this ambiguity purposefully.
- In particular, I think the long way is taken if the dot product of
- the two vectors you are interpolating between is negative but they lie in
- the same hemisphere. Our solution is to dot the two and then negate one of
- the vectors (leaving the specified orientation the same). The code to do this
- is inserted right after the cosOmega computation, and follows:
-
- /* If the above dot product is negative, it would be better to
- * go between the negative of the initial and the final, so that
- * we take the shorter path.
- */
- if ( cosOmega < 0.0 )
- {
- cosOmega *= -1;
- for (i = X; i <= W; i++)
- startQ[i] *= -1;
- }
-
- Looking back, I don't see that this code will do any good if the
- two vectors are not in the same hemispheres, but we have not done interpolation
- between disparate vectors so it has not yet bitten us.
-
- As I recall, the code in the paper was presented as an example of how
- some things could be done, not as the end-all-be-all quaternion library, so
- the above comments are not a complaint and indeed we have found the code to
- be incredibly useful.
-
- Russell Taylor
-
- --
- He who follows a path perpetuates that path.
- Practice random kindness and sensless acts of beauty.
-