
On-Line Computer Graphics Notes
Overview
To understanding the rendering process, you must master the procedure that specifies a camera and then constructs a transformation that projects a three-dimensional scene onto a two-dimensional screen. This procedure has two several components: First, the specification of a camera model; second, the conversion of the scene's coordinates from Cartesian space to the space of the camera; and finally the specification of a viewing transformation that projects that scene into image space
For a postscript version of these notes look here.
The Camera Model
We specify our initial camera model by identifying the following parameters.

The specification of
,
and
forms a viewing volume
in the shape of a pyramid with the camera position
at the apex
of the pyramid and the vector
forming the axis of the
pyramid. This pyramid is commonly referred to as the viewing
pyramid. The specification of the near and far planes forms a
truncated viewing pyramid which gives the region of space which
contains the primary portion of the scene to be
viewed (We note that objects may extend outside the trunchated
pyramid. In many situations polygons will lie between the near plane
and the camera, or, in distance, beyond the far plane.).
The
viewing transform,
transforms this truncated pyramid onto the image space volume
.
The Camera Transform
Given the definition of a camera
,
the camera transformation is a combination of a transform that
first converts the coordinates of the Cartesian frame to the local
coordinates of the camera's frame.

and, second, applies the viewing transform.
These two transformations are
usually multiplied together to form a single
matrix that
is applied to all points of the scene.
Defining a Frame at the Camera Position
The main idea here is to define a frame
at the camera position. Given such a frame
,
we generate a transformation
that converts the Cartesian Frame coordinates to the
camera's frame.
To define a frame at the camera position is easy - and
there are actually an number of ways of doing this. One of
the vectors is obvious - that is, we want
![]()
(the transformed camera should be looking along the negative w axis).
In order to define the other vectors that make up the frame, we must
make an assumption. We assume that
the vertical direction of the camera must be in the plane defined by
and the vector
. This frequently happens when you are
taking a picture, if you think about it - and it actually fairly easy
to arrange. See the following figure for an illustration of this
process. In the figure, the dotted line is the direction of view, and
should be placed on the negative z axis by the transformation.

To define
and
we utilize the following steps
We note that this works well, except when you wish to have the camera
look in the direction <0,1,0> or <0,-1,0>. In these cases, either
or
and
, and we cannot
calculate a frame in this manner. However, we can utilize another
vector as the ``up direction'' to utilize with
to obtain
.
Calculating the Matrix
To calculate the actual matrix that implements the transformation, we
can write each of the vectors
<1,0,0>,
<0,1,0> and
<0,0,1> as a linear combination of
,
, and
(Since the vectors defining
are linearly
independent).
In addition, we can write the vector
as a linear
combination of
,
and
. Thus we can calculate the
values
, where

These equations can be solved by
Cramers Rule,:
To obtain
, we have

To obtain
, we have

And to obtain
, we have

In addition, if
, then we have

to get
.
The matrix that convets the coordinates of objects in
the frame
into coordinates for the frame
is given by

Any point
can be written in the
frame
by

But by the above calculations this is equal to

which implies that the coordinate

is the coordinate of the point in the frame
.
We note, that by our construction, the frame
is an
orthonormal frame (all vectors are unit vectors and are mutually
perpendicular) and in this case the equations above simplify
tremendously.
In particular, all the denominators
, and we can simplify the numerators utilizing the identities

to obtain

The first few of these are extremely simple, as, for example
is just the first coordinate of
, etc.
Overview
The camera transform is a Cartesian-frame-to-frame transform. This is combined with the viewing transform to give a transformation that converts a scene into image space.
|
This document maintained by
Ken Joy
All contents copyright (c) 1996, 1997 |
|