next up previous
Next: Camera Transform Up: Fundamental of Computer Graphics Previous: Fundamental of Computer Graphics

World Transform

World transform is quite useful for the users. Consider the following scenario: a rotated cube, You may go through all troubles to calculate the coordinations manually; or create an ``normal'' cubic, and then apply a set of world transformation to move it to the right position.

The world transform matrix consists five matrices:

\begin{displaymath}
\mathbf{T} =
\left[ \begin{array}{llll}
1 & 0 & 0 & x \\
0...
... 0 & 0 & 1
\end{array} \right ] \textrm{- translation matrix}
\end{displaymath}


\begin{displaymath}
\mathbf{R_{x}} =
\left [ \begin{array}{llll}
1 & 0 & 0 & 0 ...
...nd{array} \right ] \textrm{- rotation about the \emph{x}-axis}
\end{displaymath}


\begin{displaymath}
\mathbf{R_{y}} =
\left [ \begin{array}{llll}
cos\beta & 0 &...
...nd{array} \right ] \textrm{- rotation about the \emph{y}-axis}
\end{displaymath}


\begin{displaymath}
\mathbf{R_{z}} =
\left [ \begin{array}{llll}
cos\gamma & -s...
...nd{array} \right ] \textrm{- rotation about the \emph{z}-axis}
\end{displaymath}


\begin{displaymath}
\mathbf{S} =
\left [ \begin{array}{llll}
S_{x} & 0 & 0 & 0...
...\
0 & 0 & 0 & 1
\end{array} \right ] \textrm{- scale matrix}
\end{displaymath}

We take the OpenGL convention for the world transform, the world transformation matrix is defined as:

\begin{displaymath}
\mathbf{W} = \mathbf{T} \times \mathbf{R_{x}} \times \mathbf{R_{y}} \times \mathbf{R_{z}} \times \mathbf{S}
\end{displaymath} (1)

Note: The order of the transfrom matrix is arbitary

And we apply the world transform matrix on the left side of the corordination $({x}, {y}, {z})$ to get the new coordination $({x'}, {y'}, {z'})$:


\begin{displaymath}
\left [ \begin{array}{l}
{x'} \\
{y'} \\
{z'} \\
c
\end{...
...begin{array}{l}
{x} \\
{y} \\
{z} \\
1
\end{array} \right ]
\end{displaymath} (2)


next up previous
Next: Camera Transform Up: Fundamental of Computer Graphics Previous: Fundamental of Computer Graphics
2007-06-20