> > > > Macro,

> > > > the task is quite clear - finding all orientations in 1 steps.

> > > > If you want to cover all single axis rotations as well, then you will

> > > > need 0..360 for each angle.

> > > > If you want all rigid body orientations, then this would be sufficient:

> > > > Psi=-180..+180

> > > > The= -90.. +90

> > > > Phi=-180..+180

> > > > Then you will have duplicate positions.

> > > Yes, that's what I meant.

> > > > Storing millions of rotation matrices doesnt look promissing.

> > > > If your body rotation is not physically restrained, then its IMO not

> > > > avoidable to allow full rotations for each angle.

> > > > You could do this by 3D tables in 10 steps and 3D linear interpolation

> > > > (45656 matrices with 9 single entries each). Unfortunately, the 3D inter-

> > > > polation is time consuming, and it has to be done for each of the nine

> > > > components.

> > > It may be too complicated :( . And if I change the interval, for instance,

> > > to 0.5 or 0.9 degrees, I have to re-do calculations :(

> > > > There is nowhere gimbal lock. The pure geometrical rotation is well

> > > > defined for all arbitrary angles.

> > > > Quaternions are probably the best choice, without storing predefined

> > > > orientations.

> > > Any further hint? I searched this topic on the web, but most articles are

> > > about interpolation.

> > The problem with "finding all possible rotations in for instance 1

> > steps" without duplication is an ill-defined problem. The topological

> > structure of 3d-rotations corresponds to the structure of a

> > 4-dimensional sphere where any pair of opposite points represent the

> > same rotation. Another equivalent structure: The set of all straight

> > lines through the origin in 4d.

> > The structures of the set of rotations and the set of point pairs on a

> > 4d-sphere are equivalent in the sense that there is a one-to-one

> > mapping between point pairs and rotations such that point pairs that

> > are "close" in the geometrical sense correspond to rotations which are

> > "close" in terms of axis and angle.

> > As you may guess the mathematical objects linking point pairs on a 4d

> > sphere and 3d rotations, i.e. objects which can represent both kinds

> > of entities are - quaternions. Pairs of unit quaternions alias 4d unit

> > vectors, to be precise, because q and -q represent the same rotation

> > if interpreted as rotations and two opposite points on a 4d unit

> > sphere if interpreted as point pairs.

> > Now the problem boils down to representing pairs of 4d unit vectors

> > with a suitable parametrization.

> > A "natural" parametrization of one half of the 4d unit sphere without

> > duplication yielding a set of quaternions representing all possible 3d

> > rotations is a parametrization using 3 angles (which have no relation

> > to Euler angles and such) a1,a2,a3.

> > x = sin(a1)sin(a2)sin(a3)

> > y = sin(a1)sin(a2)cos(a3)

> > z = sin(a1)cos(a2)

> > w = cos(a1)

> > 0 <= a3 < pi

> > 0 <= a2 < pi

> > 0 <= a1 < pi

> > using a1 as inner, a2 as middle and a3 as outer loop.

> > Regards

> > Horst

> Just curious, but would it be possible to instead iterate (by 1 degree

> using the original example) through latitude and longitudes (to get

> all axes for that increment), and also iterate angles on those axes to

> get all orientations?

Why not. Using (x,y,z) as rotation axis and phi as rotation angle

x = sin(a1)sin(a2)

y = sin(a1)cos(a2)

z = cos(a1)

0 <= a1 < pi

0 <= a2 < pi

0 <= phi < 2pi

you could iteraterate through all rotations using a1,a2 and phi as

loop parameters.

Regards

Horst