Describes the properties of a view that is being rendered.
These are properties such as the type of view (parallel or perspective), its clipping distances, width, height, zoom factor, field-of-view, etc.
#define VIEW_DEFAULT_WIDTH ((float)400.0) void SRendParams::ComputeViewParams(const ViewParams&vp) { if (vp.projType == PROJ_PERSPECTIVE) { float fac = -(float)(1.0 / tan(0.5*(double)vp.fov)); xscale = fac*dw2; // dw2 = float(devWidth)/2.0 yscale = -devAspect*xscale; } else { xscale = (float)devWidth/(VIEW_DEFAULT_WIDTH*vp.zoom); yscale = -devAspect*xscale; } } Point2 SRendParams::MapToScreen(Point3 p) { Point2 s; if (proj_type==PROJ_PERSPECTIVE) { s.x = dw2 + xscale*p.x/p.z; s.y = dh2 + yscale*p.y/p.z; } else { s.x = dw2 + xscale*p.x; s.y = dh2 + yscale*p.y; } return s; }
#include <render.h>
Public Member Functions |
|
virtual INT_PTR | Execute (int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0) |
This is a general purpose function that
allows the API to be extended in the future. |
|
Public Attributes |
|
Matrix3 | prevAffineTM |
Matrix3 | affineTM |
int | projType |
float | hither |
float | yon |
float | distance |
float | zoom |
float | fov |
float | nearRange |
float | farRange |
virtual INT_PTR Execute | ( | int | cmd, |
ULONG_PTR | arg1 = 0 , |
||
ULONG_PTR | arg2 = 0 , |
||
ULONG_PTR | arg3 = 0 |
||
) | [inline, virtual] |
This is a general purpose function that allows the API to be extended in the future.
The 3ds Max development team can assign new cmd numbers and continue to add functionality to this class without having to 'break' the API.
{ return 0; }