home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vectoper.zip / RayTrace.h < prev    next >
C/C++ Source or Header  |  1996-09-19  |  2KB  |  100 lines

  1.  
  2. /*
  3.  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  4.  +
  5.  +  ray_trace.h  -- misc definitions used in ray tracing
  6.  +
  7.  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  8.  */
  9.  
  10. /*
  11.  * #define MAX_DEPTH  4   * maximum depth of ray_tracing recursion * 
  12.  */
  13. #define MAX_DEPTH  40  /* maximum depth of ray_tracing recursion */
  14.  
  15.  
  16.  
  17. #define FREE_SPACE_LIMIT  90000
  18.  
  19. typedef struct {
  20.  
  21.      Vector d_AF;
  22.      Vector X_bar, Y_bar;
  23.      Viewport vp;
  24.  
  25.      int  obj_num;
  26.      Obj_Props  obj_props[OBJ_MAX];
  27.      Obj  obj_list[OBJ_MAX];
  28.  
  29.      Light  lights[LIGHTS_MAX];
  30.      float PhongConst;
  31.  
  32.      Vector pix_buf[800][800];
  33.      int curr_scan;
  34.      int npix;
  35.      int nscan;
  36.  
  37.      int ScanSetSize;
  38.      int FirstScan;
  39.      int ScanLimit;
  40.      int depth_limit;
  41.  
  42.      struct shared_heap_type {
  43.          int allocated_space;
  44.          char *free_space_ptr;
  45.          char free_space[FREE_SPACE_LIMIT];
  46.          int end_of_free_space;
  47.         } Sh_Heap;
  48.  
  49. } SharedType;
  50.  
  51. extern SharedType *shared;
  52.  
  53.  
  54. extern float res;     /* screen resolution in pixels */
  55.  
  56. extern int num_T;
  57. extern int nIter;
  58.  
  59. extern FILE    *ofp;
  60.  
  61. extern int nscan, npix;
  62.  
  63.  
  64.  
  65. extern Boolean  debug_flag;
  66. extern Boolean  triangle_flag;
  67.  
  68. extern Boolean  super_sample_flag;
  69.  
  70. extern Boolean XmitPixelsFlag;
  71. extern Boolean WritePixelsFlag;
  72.  
  73.  
  74.  
  75. void RayTrace();     /* function definition for ray tracing driver */
  76.  
  77. Vector RT_Trace(Ray i_ray, float n_i, int depth);
  78.  
  79. Vector RT_DirectionVector(float pix, float scan);
  80.  
  81. void RT_Configure(char *config_file);
  82.  
  83. void RT_TextureMap(Vector pt, Obj *obj_ptr, Vector *Od);
  84.  
  85. Vector RT_SuperSample(Vector Iul, Vector Iur, Vector Ill, Vector Ilr,
  86.                       Ray    Rul, Ray    Rur, Ray    Rll, Ray    Rlr,
  87.                       float scan, float pix, int d);
  88.  
  89. Vector RT_Shade(Vector RT_pt, Vector Pt_norm, Vector patch_norm, Ray RT_Iray,
  90.                 Obj *obj_ptr, Obj_Props *prop_ptr, int depth, float n_i);
  91.  
  92. Vector RT_RefractionDirection(Vector I, Vector N, float n_i, float n_t);
  93.  
  94. void RT_SetViewParams();
  95.  
  96. void RT_SetPixels(Vector Ipix[], int scan, int npix);
  97. void RT_XmitPixels (short buffer[], int scan_no, int npix);
  98. int  RT_Send (int sd, char buf[], int bytes);
  99.  
  100.