Cameras represent points of view within a scene. You can create render targets based on your cameras in order to tell Beast to render the camera's point of view to a single image. Depending on the type of camera you create, you can use the resulting images for different purposes.
Beast supports two distinct types of cameras, described in the following sections.
By default, both types of cameras are oriented to point in the negative direction of the Z axis; you can control this by setting a rotation in the matrix transform you apply to the camera. See also The Beast Coordinate System. You set the matrix transform at the time you create the camera. You can also change it at any time through a call to ILBSetCameraTransform().
Perspective cameras produce still images that represent the scene from a given position in 3D space, with a specified angular field of view.
To create a perspective camera, use the ILBCreatePerspectiveCamera() function.
You can set the horizontal field of view of the camera by calling the ILBSetFov() function.
eRnsT will use the first perspective camera defined within a scene to determine the viewer's field of vision within the game world.
Environment cameras produce environment maps: still images that record the entire world surrounding the camera. You can use these environment maps for real-time reflections, as textures for sky lights in another scene, as skybox images within the game, etc.
To create an environment camera, use the ILBCreateEnvironmentCamera() function.
In your call to ILBCreateEnvironmentCamera(), you set the type of projection that the camera will use to flatten the environment to a still image. You can use any value from the ILBEnvironmentCameraType enumeration. See the API Reference for details.
You can only set up a camera in the context of setting up a scene. See also Creating a Scene.
You do not have to close or finalize your camera before it can be used in a rendering.
For example, the following code sets up a simple perspective camera:
ILBCameraHandle camera; ILBCreatePerspectiveCamera(scene, _T("Camera"), matrix, &camera); // Set a 45 degrees fov ILBSetFov(camera, static_cast<float>(M_PI) / 4.0f, 1.0f);
API functions related to the creation and setup of cameras are declared in the beastcamera.h file.