home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / NEWS / RADIANCE / SRC / COMMON / VIEW.H < prev    next >
C/C++ Source or Header  |  1993-10-07  |  1KB  |  42 lines

  1. /* Copyright (c) 1988 Regents of the University of California */
  2.  
  3. /* SCCSid "@(#)view.h 2.2 10/2/92 LBL" */
  4.  
  5. /*
  6.  *  view.h - header file for image generation.
  7.  *
  8.  *     9/19/88
  9.  */
  10.  
  11.                 /* view types */
  12. #define  VT_PER        'v'        /* perspective */
  13. #define  VT_PAR        'l'        /* parallel */
  14. #define  VT_ANG        'a'        /* angular fisheye */
  15. #define  VT_HEM        'h'        /* hemispherical fisheye */
  16.  
  17. typedef struct {
  18.     int  type;        /* view type */
  19.     FVECT  vp;        /* view origin */
  20.     FVECT  vdir;        /* view direction */
  21.     FVECT  vup;        /* view up */
  22.     double  horiz;        /* horizontal view size */
  23.     double  vert;        /* vertical view size */
  24.     double  hoff;        /* horizontal image offset */
  25.     double  voff;        /* vertical image offset */
  26.     FVECT  hvec;        /* computed horizontal image vector */
  27.     FVECT  vvec;        /* computed vertical image vector */
  28.     double  hn2;        /* DOT(hvec,hvec) */
  29.     double  vn2;        /* DOT(vvec,vvec) */
  30. } VIEW;            /* view parameters */
  31.  
  32. extern VIEW  stdview;
  33.  
  34. extern char  *setview();
  35.  
  36. #define  viewaspect(v)    sqrt((v)->vn2/(v)->hn2)
  37.  
  38. #define  STDVIEW    {VT_PER,0.,0.,0.,0.,1.,0.,0.,0.,1.,45.,45.,0.,0.}
  39.  
  40. #define  VIEWSTR    "VIEW="
  41. #define  VIEWSTRL    5
  42.