Class RenderInfo

3DS Max Plug-In SDK

Class RenderInfo

See Also: Class Ray, Class Point2, Class Point3.

class RenderInfo

Description:

This class provides information about the rendering environment. All methods of this class are implemented by the system.

Data Members:

public:

ProjectionType projType;

The projection type: One of the following values:

ProjPerspective

ProjParallel

float kx,ky;

3D to 2D projection scale factor.

float xc,yc;

The screen origin.

BOOL fieldRender;

Indicates if the image is field rendered.

BOOL fieldOdd;

If TRUE, the first field is Odd lines.

TimeValue renderTime[2];

Render time for the 2 fields, if field rendering. If not, use renderTime[0].

Matrix3 worldToCam[2];

The world to camera transformation matrix; worldToCam[0] is for field 0, worldToCam[1] is for field 1. Use worldToCam[0] if not field rendering.

Matrix3 camToWorld[2];

The camera to world transformation matrix; camToWorld[0] is for field 0, camToWorld[1] is for field 1. Use camToWorld[0] if not field rendering.

Rect region;

This data member is available in release 4.0 and later only.

This rectangle holds the sub-region in the image that was rendered if the last render was a region render. If it was not a region render then the rectangle is empty.

Methods:

Prototype:

RenderInfo();

Remarks:

Constructor. The data members are initialized as follows:

 renderTime[0] = renderTime[1] = 0;

 worldToCam[0].IdentityMatrix();

 worldToCam[1].IdentityMatrix();

 camToWorld[0].IdentityMatrix();

 camToWorld[1].IdentityMatrix();

 fieldRender = fieldOdd = FALSE;

 projType = ProjPerspective;

 kx = ky = 1.0f;

 xc = yc = 400.0f;

Prototype:

Point2 MapWorldToScreen(Point3 p, int field=0)

Remarks:

Maps the specified world point to a screen point.

Parameters:

Point3 p

The world point.

int field=0

The field order. This specifies which camToWorld matrix is used in the conversion.

Return Value:

The 2D screen point.

Prototype:

Point2 MapCamToScreen(Point3 p);

Remarks:

Maps the specified point in camera space to screen space and returns it.

Parameters:

Point3 p

The point to convert.

Prototype:

Ray MapScreenToCamRay(Point2 p);

Remarks:

Returns the viewing ray through the screen point, in camera space.

Parameters:

Point2 p

The screen point.

Prototype:

Ray MapScreenToWorldRay(Point2 p, int field=0);

Remarks:

Returns the viewing ray through the specified screen point, in world space.

Parameters:

Point2 p

The screen space point.

int field=0

The field order - specifies which camToWorld matrix is used in the conversion.