Exporting cameras

Maxwell requires at least one camera to be able to render a scene. The MXS file format allows the creation of more than one camera, although only one of them can be set as the active view.

Cameras are created with the function:

Ccamera addCamera (
                    const char* pName,
                   dword nSteps,
                   real shutter,
                   real filmWidth,
                   real filmHeight,
                   real iso,
                   const char* pDiaphragmType,
                   real angle,
                   dword nBlades,
                   dword fps,
                   dword xRes,
                   dword yRes,
                   real pixelAspect
                   );

This method returns a Ccamera object that is filled with the following methods:

Cmaxwell::Ccamera::setStep (
                             dword iStep,
                             Cpoint origin, Cpoint focalPoint, Cvector up,
                             real focalLength, real fStop,
                             byte focalLengthNeedCorrection = true
                            );

When exporting MXS sequences for animations, the camera should be created (using addCamera) before entering in the animation loop, and the setStep method is used in each frame to animate the position and optical parameters.

Additional camera parameters

Cmaxwell::Ccamera::setActive();
// Sets the camera as the active one

Cmaxwell::Ccamera::setCutPlanes (real min, real max, bool isZClipEnabled);
// Zclip planes (0.0 to 1E7.0, min = 0 by default, max = 1E7 by default)

Cmaxwell::Ccamera::setShiftLens (real shiftX, real shiftY);
// Shift lens  shift -100.0 to 100.0, 0 by default

// Render Region
Cmaxwell::Ccamera::setScreenRegion (dword x1, dword y1, dword x2, dword y2, const char *pType);
//The method setScreenRegion is used to render a region. pType can be "REGION" or "BLOW UP". Read the Maxwell Render documentation for details.

The Maxwell camera model requires a focal length correction based on the actual focal point. This is made internally when the fcorrection parameter is true.

 

Â