Rib
Setting up a Basic Camera



# disk1.rib
# setting a perspective view
 
Display "disk1" "framebuffer" "rgb"
Projection "perspective" "fov" 40
Format 320 240 1
 
WorldBegin
    Disk 3 0.25 360
WorldEnd

The purpose of this tutorial is to present a minimal renderman scene. The first two lines show the use of the hash symbol "#" for comments. Display, Projection and Format are rib statements that define the basic characteristics of the camera. These statements, and others that begin each line, must be spelled exactly as shown ie. a single word with one or more upper case letters.

Display has three parameters to specify

  • the name of the image,
  • where to put the image, and
  • what information the image should contain.

The parameters for Projection specify,

  • perspective or orthographic projection, and the
  • field of view measured in degrees.

The parameters for Format specify,

  • image width,
  • image height, and
  • the pixel aspect ratio.

WorldBegin notifies the renderer that objects comprising the 3D scene are about to be defined. Disk is a rib statement that defines, by its three numeric parameters a flat circular disk situated 5 units along the z axis, 0.5 units in radius and 360 degrees in circumference. Parameters must be separated by at least one space. They may, however, be spread over several lines and have comments at the end of each line. For example, the disk could have been specified as follows.

    Disk
    5   # units along the z axis
    0.5 # units in radius
    360 # degrees

Finally, WorldEnd indicates the description of the scene, or world, has been completed. This small rib file is interesting not just for what it describes but also for what it omits. Although it does not specify the material characteristics of the disk, or how it is lit, the renderer is able to produce an image because, in the absence of specific information, it uses default settings.



# example1.rib
# setting a perspective view
 
Display "disk1" "framebuffer" "rgb"
Projection "perspective" "fov" 40
Format 320 240 1

Two comments about the scene.


Set the camera to give a perspective view with a field of vision of 40 degrees and a frame size of 320 by 240 pixels.

WorldBegin

Begin describing the contents of the 3D scene.

    Disk 3 0.25 360

Create a disk 3 units along the z axis of the camera, 0.25 units in radius and 360 degrees in circumference.

WorldEnd

Conclude the description of the 3D scene.




© 2002- Malcolm Kesson. All rights reserved.