banner.gif
On-Line Computer Graphics Notes
COORDINATE CONVERSION
BETWEEN AN ARBITRARY FRAME
AND THE CARTESIAN FRAME


Overview

Given two frames in three-dimensional space, it is possible to develop a $ 4 \times 4$ matrix that converts coordinates from one frame to coordinates of another. Here we discuss the special case of converting the local coordinates of an object specified in an arbitrary frame to the coordinate system specified by the Cartesian frame. This conversion matrix is useful in the construction of complex transformations, as in many cases it is worthwhile to first convert to the Cartesian frame, do our operations in this well-known space, and then convert back.

pdficonsmall.gif For a pdf version of these notes look here.


The Problem

Given a Frame $ {\cal F} = ( {\vec u} , {\vec v} , {\vec w} , {\bf O} )$, let $ {\cal F}_C $ be the Cartesian frame

$\displaystyle (<1,0,0>,<0,1,0>,<0,0,1>,(0,0,0))
$

If we have a point $ {\bf P} $ that has local coordinates $ (u,v,w)$ in the frame $ {\cal F} $, what coordinates does this point have with respect to the Cartesian frame?


Developing the Conversion Matrix

We wish to find coordinates $ (x,y,z)$, such that

$\displaystyle \left[ \begin{array}{cccc} x & y & z & 1 \end{array} \right] \lef...
...in{array}{c} {\vec u} \\  {\vec v} \\  {\vec w} \\  {\bf O} \end{array} \right]$ (1)

We know that that vectors $ <1,0,0>$, $ <0,1,0>$ and $ <0,0,1>$ are linearly independent and form a basis for the vector space of vectors in $ \Re^3$. Therefore, we can write each of $ {\vec u} $, $ {\vec v} $ and $ {\vec w} $ as a linear combination of these basis vectors:

$\displaystyle {\vec u}$ $\displaystyle = u_1 <1,0,0> + u_2 <0,1,0> + u_3 <0,0,1>$    
$\displaystyle {\vec v}$ $\displaystyle = v_1 <1,0,0> + v_2 <0,1,0> + v_3 <0,0,1>$    
$\displaystyle {\vec w}$ $\displaystyle = w_1 <1,0,0> + w_2 <0,1,0> + w_3 <0,0,1>$    

In addition, since $ {\bf P} -(0,0,0)$ is a vector, we can write the point $ {\bf O} $, as

$\displaystyle {\bf O} \: = \: o_1 <1,0,0> + o_2 <0,1,0> + o_3 <0,0,1> + (0,0,0)
$

and so the frame $ {\cal F} $ can be written as

$\displaystyle \left[
\begin{array}{c}
{\vec u} \\
{\vec v} \\
{\vec w} \\  ...
...in{array}{c}
<1,0,0> \\
<0,1,0> \\
<0,0,1> \\
(0,0,0)
\end{array}\right]
$

Substituting into equation (1), we have

$\displaystyle \left[
\begin{array}{cccc}
x & y & z & 1
\end{array}\right]
\left...
...in{array}{c}
<1,0,0> \\
<0,1,0> \\
<0,0,1> \\
(0,0,0)
\end{array}\right]
$

which says that

$\displaystyle \left[
\begin{array}{cccc}
x & y & z & 1
\end{array}\right]
\: = ...
... v_3 & 0 \\
w_1 & w_2 & w_3 & 0 \\
o_1 & o_2 & o_3 & 1
\end{array}\right]
$

So if we know the Cartesian coordinates of the vectors $ {\vec u} $, $ {\vec v} $, $ {\vec w} $ and the origin $ {\bf O} $, the matrix is trivial to write down since the rows of the matrix just consist of these coordinates.

Summary

We have developed a matrix that represents a the change between the local coordinates in an arbitrary frame and the coordinates of the Cartesian frame. This is a simple transformation to calculate, as the rows of the matrix are just the coordinates of the vectors and the origin of the frame $ {\cal F} $ in Cartesian coordinates.

This transformation is the inverse of the transformation that converts from the Cartesian Frame to an arbitrary frame.


Return to the Graphics Notes Home Page
Return to the Geometric Modeling Notes Home Page
Return to the UC Davis Visualization and Graphics Group Home Page


This document maintained by Ken Joy

Mail us your comments

All contents copyright (c) 1996, 1997, 1998, 1999
Computer Science Department
University of California, Davis

All rights reserved.


Ken Joy
1999-12-06