Globals: Viewport Info

LightWave

 
Instance Update Item Info Globals Table of Contents

Viewport Info

Availability  LightWave 7.5 Component  Layout
Header  lwrender.h

The viewport info global returns information about the state of Layout's OpenGL viewports. The data is read-only, but you can set the parameters using navigation and display commands.

Global Call

   LWViewportInfo *vpinfo;
   vpinfo = global( LWVIEWPORTINFO_GLOBAL, GFUSE_TRANSIENT );
The global function returns a pointer to an LWViewportInfo.
   typedef struct st_LWViewportInfo {
        int               numViewports;
        int             (*type)  (int);
        unsigned int    (*flags) (int);
        void            (*pos)   (int, LWDVector);
        void            (*xfrm)  (int, double mat[9]);
        void            (*clip)  (int, double *hither, double *yon);
        void            (*rect)  (int, int *left, int *top, int *width, int *height);
   } LWViewportInfo;
numViewports
The number of viewports visible in the Layout interface.

view = type( i )
The type of view in the ith viewport. It will be one of the following:
LVVIEWT_NONE
LVVIEWT_TOP
LVVIEWT_BOTTOM
LVVIEWT_BACK
LVVIEWT_FRONT
LVVIEWT_RIGHT
LVVIEWT_LEFT
LVVIEWT_PERSPECTIVE
LVVIEWT_LIGHT
LVVIEWT_CAMERA
LVVIEWT_SCHEMATIC

 

 
 
 

flags = flags( i )

Returns a set of bit flags for the  ith viewport. These can be any combination of the following. 
LWVIEWF_CENTER
LWVIEWF_WEIGHTSHADE
LWVIEWF_XRAY
pos(i, spot)
Fills the spot vector with the viewing position of the  ith viewport.
xfrm( i, mat[9] )
Fills mat with a 3x3 transformation from world coordinates to viewport cordinates for the  ith viewport.

clip( i, &hither, &yon )
Fills hither and yon with the near and far Z clipping distances for the  ith viewport. 

 

rect( i, &left, &top, &width, &height )
Fills left, top, width and height with pixel coordinates of the  ith viewport.