A CameraObject represents a camera in Cinema 4D. It is based on BaseObject (see BaseObject Manual).
CameraObject objects are an instance of Ocamera
.
A CameraObject is typically obtained from a BaseDraw representing a viewport window. This BaseDraw is obtained from the a BaseDocument.
See also BaseDocument Editor Windows.
Also a generator can contain a CameraObject. To get the real camera from that generator a message has to be sent to that generator:
CameraObject objects are created with the usual tools:
A new or existing camera can be set as the active scene camera:
The parameters of a CameraObject are edited as usual with C4DAtom::GetParameter() and C4DAtom::SetParameter(). The parameter IDs are defined in Ocamera.h
.
For some parameters dedicated functions exist.
These functions access the camera projection setting:
These functions set the camera zoom value:
These functions set the camera position. This is the midpoint for orthogonal projections (Front/Back/Top/Bottom etc.).
These functions set the camera aperture value:
These functions set the camera focus value:
A CameraObject can also store information about the stereoscopic cameras it represents.
The stereo camera information is stored in a StereoCameraInfo structure object: