home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / GRAPHICS / rayshade.lzh / raytrace.h < prev    next >
Text File  |  1990-05-08  |  2KB  |  55 lines

  1. /*
  2.  * raytrace.h
  3.  *
  4.  * Copyright (C) 1989, Craig E. Kolb
  5.  *
  6.  * This software may be freely copied, modified, and redistributed,
  7.  * provided that this copyright notice is preserved on all copies.
  8.  *
  9.  * There is no warranty or other guarantee of fitness for this software,
  10.  * it is provided solely .  Bug reports or fixes may be sent
  11.  * to the author, who may or may not act on them as he desires.
  12.  *
  13.  * You may not include this software in a program or other software product
  14.  * without supplying the source, or without informing the end-user that the
  15.  * source is available for no extra charge.
  16.  *
  17.  * If you modify this software, you should include a notice giving the
  18.  * name of the person performing the modification, the date of modification,
  19.  * and the reason for such modification.
  20.  *
  21.  * $Id: raytrace.h,v 3.0 89/10/27 02:06:03 craig Exp $
  22.  *
  23.  * $Log:    raytrace.h,v $
  24.  * Revision 3.0  89/10/27  02:06:03  craig
  25.  * Baseline for first official release.
  26.  * 
  27.  */
  28. typedef struct {
  29.     float x, y, size;    /* location and size */
  30.     Color ul, ur, ll, lr;    /* Color values of four corners */
  31. } pixel_square;
  32.  
  33. pixel_square *SquareStack;
  34. double Minsquare;
  35.  
  36. /*
  37.  * "Dither matrices" used to encode the 'number' of a ray that samples a
  38.  * particular portion of a pixel.  Hand-coding is ugly, but...
  39.  */
  40. int OneSample[1] =     {0};
  41. int TwoSamples[4] =    {0, 2,
  42.              3, 1};
  43. int ThreeSamples[9]=     {0, 2, 7,
  44.              6, 5, 1,
  45.              3, 8, 4};
  46. int FourSamples[16] =    { 0,  8,  2, 10,
  47.              12,  4, 14,  6,
  48.               3, 11,  1,  9,
  49.              15,  7, 13,  5};
  50. int FiveSamples[25] =    { 0,  8, 23, 17,  2,
  51.              19, 12,  4, 20, 15,
  52.               3, 21, 16,  9,  6,
  53.              14, 10, 24,  1, 13,
  54.              22,  7, 18, 11,  5};
  55.