MAPaint Technical Report:
Coordinate Transformation
|
Next: Viewing Planes
Up: Geometry
Previous: Geometry
There are many ways to define an arbitrary rotation, scaling and
translation of one coordinate frame into another. For the purposes
of the paint program we define a set of parameters for viewing
arbitrary planes through reconstructions which seem to be the most
useful in terms of the way in which the paint program will be used
and which should be easy to visualise for the user. The relationship
between these transforms and the general affine transform used
elsewhere is most easily found be direct comparison of the transform
matrix elements.
We define a viewing plane by defining a new set of coordinate axes
such that the new z-axis is along the ``line-of-sight''. This axis
is fully determined by defining a single fixed point which is the
new coordinate origin. The actual view plane is then defined to
be perpendicular to this axis and is determined by
a scalar distance parameter along the new axis. In this way the
transformation between the original,
,
and
viewing coordinates,
,
is
determined by a 3D rotation and translation with the viewing plane
defined as a plane of constant z' = d. These parameters are dipicted
in figure 3.
Figure:
The viewing plane is defined to be perpendicular
to the viewing direction given by angles
and
which are
yaw and pitch respectively. The actual plane is distance d from the
fixed point f.
 |
A 3D rotation can be defined in terms of Eulerian
angles[3, page 107]
which are not consistently defined in the literature,
but for which we assume the usual
British definition[9, page 9],
where a rotation about an axis is clockwise in the
direction of the axis and the second rotation is about the new y-axis:
- 1.
- rotate by angle
(xsi) about the z-axis
- 2.
- rotate by angle
(eta) about the new y-axis,
- 3.
- rotate by angle
(zeta) about the new z-axis.
This sequence is depicted in figure 4.
The rotation matrix defined by these angle is most easily determined
as a product of three rotations:
 |
(1) |
where in matrix notation
Figure:
The Eulerian angles. The line of intersection
between the original x-y plane and the new x'-y' plane is known as the
``line of nodes'' and shown extended in red in the figure. The x' axis
is below the original plane and not shown.
 |
Multiplying the individual matrices yields
A rigid body transformation can be described as a rotation followed
by a translation. In our case we may wish to display the section with
magnification and therefore the transformation from screen to object
coordinates will also involve scaling. With this in mind we define the
transform from object to viewing coordinates as
 |
(5) |
where s is the scaling and
is the fixed point in the original
coordinates. Most of the calculations we require involve the inverse
transform
 |
(6) |
where
R-1 = RT (transposed matrix)[3].
Next: Viewing Planes
Up: Geometry
Previous: Geometry
Richard Baldock
1998-06-05