ch
...@rumburakhq.ping.de wrote in message
<6sot1m$p1
...@nnrp1.dejanews.com>...
>Some weeks ago I posted a question, where I ask how it is possible to
>average a number of orientations of an object which are encoded with
>quaternions.
>The answer was to just add the quaternions up, and normalize the sum.
>It seems that this should work well, but I've got some problems.
>This is what I am doing:
>- I've got some rotation matrices of an object which encodes the
>transformation from object to world space. - These matrices are converted
>into quaternions, summed up, and finally normalized. - I convert the final
>orientation back into a matrix.
>Everything does work fine, until my objects at-vector becomes nearly
>equal to (0,0,-1). The averaged rotation then does not show the expected
>result, and the movement becomes very jercy.
>I found out, that if the at vector is nearly (0,0,-1) the length of
>the converted quaternion is not one and thus not representing a rotation
>any longer.
>I do not know why this happens, and I would be happy if anyone could
>explain this behaviour.
The
quaternions can be viewed geometrically as points on the unit
sphere in 4D. Consider the analogous problem for points on the
unit sphere in 3D. If the minimum cone containing the points has
angle of at most pi/2 radians (measured from cone axis to cone
boundary), then a normalized average is a point on the sphere and
inside the cone and in some geometric sense is a good candidate
for what an "average" point in the original set might appear to be.
(I prefer using the cone axis as a better candidate, thought of as
the "median" of the original points.)
However, if the cone angle is pi/2 or larger, than the normalized
average makes less geometric sense as a representative of
the original points. It is not clear that any other representative
is useful. If the original point set represents the normals of triangles
in a mesh that share a common vertex, the normalized average or
cone axis are choices for a "vertex normal". However, note that
when the cone angle is pi/2 or larger, the surface is "ruffled" at
the common vertex, so it is not clear what a good vertex normal
is.
For quaternions, the analogy holds. The points lie on a hypersphere
and are contained by a minimal hypercone. If the hypercone is too
large, the normalized average may not be meaningful. The quaternions
provide a different twist from my previous paragraph. Recall that q
and -q represent the same rotation. If your set of quaternions do not
all lie on the half-hypersphere, then the minimal hypercone containing
them is too large. Instead you should be able to construct an algorithm
to take the original set of quaternions and change signs on some of
them to produce a set that does lie on a half-hypersphere. Then the
normalized average should have better behavior.
Dave Eberly
ebe...@cs.unc.edu