![]() |
![]() |
![]() |
![]() |
"LW Camera Info"Availability: LightWave 6.0 The camera info global returns functions for getting camera-specific information about any of the cameras in a scene. Use the item info global to get the camera list and for generic item information. The information returned by these functions is read-only. Global Call LWCameraInfo *caminfo; caminfo = global( "LW Camera Info", GFUSE_TRANSIENT ); The global function returns a pointer to an LWCameraInfo. typedef struct st_LWCameraInfo { double (*zoomFactor) (LWItemID, LWTime); double (*focalLength) (LWItemID, LWTime); double (*focalDistance) (LWItemID, LWTime); double (*fStop) (LWItemID, LWTime); double (*blurLength) (LWItemID, LWTime); void (*fovAngles) (LWItemID, LWTime, double *horizontal, double *vertical); } LWCameraInfo;
Example This code fragment collects information about the first camera. #include <lwserver.h> #include <lwrender.h> LWItemInfo *iteminfo; LWCameraInfo *caminfo; LWItemID id; LWTime t = 3.0; /* seconds */ double zoom, flen, fdist, fstop, blen, hfov, vfov; iteminfo = global( "LW Item Info 2", GFUSE_TRANSIENT ); caminfo = global( "LW Camera Info", GFUSE_TRANSIENT ); if ( iteminfo && caminfo ) { id = iteminfo->first( LWI_CAMERA, NULL ); zoom = caminfo->zoomFactor( id, t ); flen = caminfo->focalLength( id, t ); fdist = caminfo->focalDistance( id, t ); fstop = caminfo->fStop( id, t ); blen = caminfo->blurLength( id, t ); fovAngles( id, t, &hfov, &vfov ); } |