
On-Line Geometric Modeling Notes
In computer graphics we manipulate objects. These may include light sources, cameras, and objects in our scenes. Each of these is likely to be defined in its own coordinate system and then placed within the scene we are modeling. We must be able to relate these coordinate systems, both to a global coordinate system and to each other. We place coordinate systems into an affine space through the use of frames.
We first discuss the
definition of a frame and give several
examples of frames including the well known
Cartesian Frame.
A matrix representation of
points and vectors under a given frame is
developed and utilized to discuss the
conversion of coordinates between frames
The method of conversion is developed first through
a specific two dimensional example which shows
that the problem can be solved by developing a
conversion
matrix.
The general n-dimensional case is then
discussed. We
conclude with a discussion of
how to generate this conversion matrix.
For a postscript version of these notes look here.
Let
be an
affine space
of dimension n. Let
be a point
in this space and let
be any basis for
. We call the
collection
a frame
for
. Frames form coordinate systems in our affine space.
That is, if we consider a point
,
can be written as
, where
is the origin of the frame and
is a vector.
Since the
forms a basis for
, we have
that the vector
can be written uniquely as
![]()
and so the point
can be written uniquely as
![]()
The set of values
are the coordinates of
relative to the frame
.
Examples of Frames
Two-dimensional examples of frames are fairly straightforward to
produce. We will denote the frames as
.
In fact, we can define a Cartesian frame for any dimension. It consists of the origin (0, 0, ..., 0), and the vectors <1,0,..,0>, <0,1,..,0>, ..., <0,0,..,1>. This is the frame that we normally refer to when discussing points in multiple dimensions.
Points and vectors can be uniquely identified by the coordinates
relative to a specific frame.
Given a frame
in an affine space
, we can write a point
uniquely as
![]()
This can also be written as

Similarly, since the vectors of our affine space form a
vector space,
we can write a vector
uniquely as
![]()
and this can be written as

Thus, points are represented as row vectors whose last component is 1 and vectors are represented as row vectors whose last component is 0 (zero).
A useful technique is, when given two different frames, to take a point that has a certain set of coordinates in one frame and find its coordinates in the second frame. Most readers will do this routinely, relating points back to the Cartesian frame. But what if the second frame is not the Cartesian frame?
It is useful to study a two dimensional example of this process before proceeding in general.
Consider the two frames
and
where

These frames are shown in the figure below

Suppose we have the point
, with coordinates ( 3, 2 ) in the
frame
. What are the coordinates of the point
in the frame
?
This is straightforward to calculate using the
matrix notation for the
points.

and therefore the new coordinate is (3,0) under the frame
.
Now carefully note what we did in this calculation. First we wrote
the point in the
matrix notation for
the frame
.
Then we wrote the vectors of the first frame in terms of the vectors
of the second frame - and we can do this since the vectors of the
second frame (any frame actually) form a basis for the space of
vectors. Then we wrote the origin
in terms of the origin and
vectors of the second frame. This column vector, expressing the first
frame in terms of the second, was converted to the product of
a
matrix and the column vector representing the second
frame. We then
multiplied the
matrix times the initial coordinate to
obtain the result.
This can be done with any coordinate from the first frame, as the
matrix generated will be the same in every case. That
is, given a coordinate (u,v) from the first frame, we can convert it
to a coordinate for the second frame by simply calculating

To convert coordinates from one frame to another in n-dimensional space proceeds in the same way as the example above.
Suppose a point
has coordinates
relative
to some frame
.
What would be
the coordinates of
relative to another frame
?
Well since
is a basis, we can write
each of the vectors
uniquely in terms of
the
. In
addition, since
is a vector, we can also write
uniquely
in terms of the
and
. Thus we can calculate coefficients
defined by
![]()
for i = 1, 2, ..., n and
![]()
So now we can write

and since the vectors
are linearly independent we have that the coordinates
of the point in the second frame is

Thus the change of coordinates is accomplished via a matrix
multiplication. We note that the rows of the matrix consist of the
coordinates of the elements of the old frame
relative to the new
frame
.
We also note that if we consider the frames in three dimensional space
(i.e. n=3), the matrix is
.
So how do we calculate the matrix

which is required for the conversion of the coordinates of a point in
one frame to those of another? We use
Cramer's Rule.
Since most of the calculations we are required to do are in 3
dimensions, we will present the techniques for calculating the matrix
in this special case - where the frames will now be denoted as
and
and the matrix will be

So how do we find the values
?
Given any frame
, and a vector
,
I know that
for some u, v and w. Utilizing
Cramer's Rule,
I can calculate these coordinates
directly by the following process: If we define

then we can calculate

Utilizing this process, we can let
, and
we can let
and calculate
,
and
;
we can let
and calculate
,
and
;
we can let
and calculate
,
and finally
we can let
and calculate
,
and
.
So using Cramer's rule, the calculations are straightforward and consist of taking a few cross products and dot products.
See the section on Cramer's Rule for more information when the frames are orthonormal.
|
This document maintained by
Ken Joy
All contents copyright (c) 1996, 1997 |
|