Logitech Magellan/SPACE MOUSE Classic Programmer's Manual page 19

Logicad3d
Table of Contents

Advertisement

P
= [R](P
) + T
new
old
XYZ
This equation describes the one-step motion of
the graphical cube as represented by its eight
corner points. Shown explicitly, this formula
consists of the following three equations:
P
= (R
)(P
) + (R
new X
11
old X
(R
)(P
) + X
13
old Z
P
= (R
)(P
) + (R
new Y
21
old X
(R
)(P
) + Y
23
old Z
P
= (R
)(P
) + (R
new Z
31
old X
(R
)(P
) + Z
33
old Z
These equations do not change the size or
shape of the cube (its edges are the same
length as before and its corners are still right
angles). In other words, after applying the
above equations, we have a cube identical to
the original but with a different position and
orientation in space.
For example, suppose the Magellan/SPACE
MOUSE delivers the following set of values:
X = 0.5
Y = 0
A = 0
B = 0
The new position and orientation taken by the
cube are computed by plugging the rotation
matrix values and the original coordinates of
the cube's eight corners into the combined
equations for translation and rotation. The
calculation is shown below for the first point,
P
.
1
1
0 .
0
0 .
é
ê
0
0 .
. 0
955
R =
ê
ê
0
0 .
. 0
296
ë
P
= (1.0)(1) + (0.0)(1) +
1 new_X
(0.0)(1) + 0.5
P
= (0.0)(1) + (0.955)(1) +
1 new_Y
(0.296)(1) + 0
P
= (0.0)(1) + (-0.296)(1) +
1 new_Z
(0.955)(1) – 4.0
Similar calculations for the other seven points
yield the following new set of points:
P
(1.5, 1.251, -3.340)
1 new
P
(-0.5, 1.251, -3.340)
2 new
P
(-0.5, -0.660, -2.749)
3 new
P
(1.5, -0.660, -2.749)
4 new
P
(1.5, 0.660, -5.251)
5 new
P
(-0.5, 0.660, -5.251)
6 new
P
(-0.5, -1.251, -4.660)
7 new
P
(1.5, -1.251, -4.660)
8 new
Note that the Magellan/SPACE MOUSE delivers
[signed] integers that may be transformed into
signed, floating-point decimals using unique
scalings for translation and rotation. Thus the
above set of example values is possible. The
)(P
) +
12
old Y
)(P
) +
22
old Y
)(P
) +
32
old Y
Z = -4.0
C = 0.3
0
0 .
ù
ú
. 0
296
ú
ú
. 0
955
û
= 1.5
= 1.251
= -3.340
choice of an appropriate scaling factor for
translation and another for rotation is
dependent on the tasks to be performed and
the available graphics and computational
power of the computer.
Continual Motion
After this one-step motion of the cube, the
graphics system continues to accept new
values from the Magellan/SPACE MOUSE,
which are indicating that the cube's
translational and rotational motions should
continue. These new motions must be
integrated into the above equations.
For translation this simply means adding the
motions. The total translation after proceeding
from step n-1 (the previous step) to step n
(the current step) is given by the following
equations:
n
n
1
å
å
=
+
X
X
i
i
i
=
1
i
=
1
n
n
1
å
å
=
+
Y
Y
Y
i
i
=
=
i
1
i
1
n
n
1
å
å
=
+
Z
Z
i
i
=
=
i
1
i
1
n
1
å
X
Note that
,
i
i
=
1
translations summed up to step n-1 and
n
n
å
å
X
Y
,
and
i
i
=
=
i
1
i
1
to the computer by the Magellan/SPACE
MOUSE in the current step, step n .
To calculate the total rotation, the successive
rotation matrices must be multiplied. The
values A, B and C are used to calculate the
rotation matrix R
above for one-step motion). The rotation
matrix R*
, which combines all previous
n-1
rotations, is generated by successive
multiplications of the rotation matrices up to
the previous step, step n-1 . (Matrices that are
the result of successively multiplying all
previous matrices will be denoted with a star
[*].) This matrix represents all previous
rotational motions. To compute the total
rotation matrix R*
(matrix R*
) must be combined with the
n-1
rotation of the current step (matrix R
consists of multiplying the two 3x3 matrices.
R*
= [R
][R*
n
n
19
X
n
n
Z
n
n
1
n
1
å
å
Y
Z
and
are the
i
i
i
=
1
i
=
1
n
å
Z
are the values sent
i
=
i
1
for step n (just as described
n
, all previous rotations
n
). This
n
]
n-1

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Magellan/space mouse plusMagellan/space mouse plus xt

Table of Contents