![]() |
![]() |
![]() |
![]() |
Backdrop InfoAvailability LightWave 6.0 The backdrop info global returns a function that evaluates the color of the backdrop in a specific direction at a given time, as well as the type, colors and squeeze values for the default solid backdrop. The parameters are read-only, but you can set them using commands. Global Call LWBackdropInfo *bkdropinfo; bkdropinfo = global( LWBACKDROPINFO_GLOBAL, GFUSE_TRANSIENT ); The global function returns a pointer to an LWBackdropInfo. typedef struct st_LWBackdropInfo { void (*backdrop) (LWTime, const double ray[3], double color[3]); int type; void (*color) (LWTime, double zenith[3], double sky[3], double ground[3], double nadir[3]); void (*squeeze) (LWTime, double *sky, double *ground); } LWBackdropInfo;
Example This code fragment shows how to obtain the backdrop color in a given direction. #include <lwserver.h> #include <lwrender.h> LWBackDropInfo *bkdropinfo; double ray[ 3 ], color[ 3 ], dx, dy, dz, d; LWTime t; bkdropinfo = global( LWBACKDROPINFO_GLOBAL, GFUSE_TRANSIENT ); if ( !bkdropinfo ) return AFUNC_BADGLOBAL; ... /* normalize the direction ray */ d = sqrt( dx * dx + dy * dy + dz * dz ); if ( d > 0 ) { ray[ 0 ] = dx / d; ray[ 1 ] = dy / d; ray[ 2 ] = dz / d; bkdropinfo->backdrop( t, ray, color ); ... |