3. The Camera - Our window into the world
The `camera' is central to the raytracing process. It represents the viewer in the scene. It forms the origin from where all the rays are shot. Given
below is a description of how the camera (or view) coordinate system is aligned
with respect to the world coordinate system.
- The Coordinate System -
The view coordinate system has its origin at the view_coordinate_center.
The eye is the actual location of the camera. The view coordinate axes
u and v
are oriented according to the up_vector. The up_vector tells the system
which direction is the positive u-axis with respect to the world coordinate
system.
The look_at vector is point at which the viewer wants to look
(the center of his view) in the world coordinate system. The view_ direction
is now calculated
as the vector from the view_coordinate_center to the look_at point. This is the
direction along which the n-axis of the view coordinate system gets aligned.
The image is formed at the origin of the view coordinate system in the u-v
plane.
Figure 1
- Camera Specification -
The camera is to be specified by the user in the scene file. It consists of the
following parameters -
- View Coordinate Center (in world coordinates)
- Eye (in view coordiantes)
- Up Vector (in world coordinates)
- Look At point (in world coordinates)
- Far Plane distance (in world coordinates)
- Horizontal Field of View (in degrees)
- Vertical Field of View (in degrees)
The various parameters can be understood with the help of the figures 1 and 2. A sample camera specification is also given.
Figure 2
A sample camera specification in a scene file -
camera
{
  -100.0 100.0 150.0 1.0
  0.0 0.0 -20.0 1.0
  0.0 1.0 0.0 1.0
  50.0 50.0 0.0 1.0
  1000.0
  45.0
  45.0
}
[ Back ]
Page last updated on 04 October, 2005.
|
AT cse.iitd.ac.in
|
© Parag Chaudhuri , 2009
|
|