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

  1. /*
  2.  * constants.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: constants.h,v 3.0 89/10/27 02:05:48 craig Exp $
  22.  *
  23.  * $Log:    constants.h,v $
  24.  * Revision 3.0  89/10/27  02:05:48  craig
  25.  * Baseline for first official release.
  26.  * 
  27.  */
  28.  
  29. #define LIGHTS        10        /* Max # of lights */
  30.  
  31. /*
  32.  * Primitive type constants.  When adding primitives, insert *before*
  33.  * "LIST" and increment LIST and GRID values, otherwise arrays of
  34.  * intersection/normal/extent routines in intersect.c won't be indexed
  35.  * correctly.
  36.  */
  37. #define SPHERE        0
  38. #define BOX        1
  39. #define TRIANGLE    2
  40. #define SUPERQ        3
  41. #define PLANE        4
  42. #define CYL        5
  43. #define POLY        6
  44. #define PHONGTRI    7
  45. #define CONE        8
  46. #define HF        9
  47. #define LIST        10
  48. #define GRID        11
  49.  
  50. #define PRIMTYPES    10    /* # of types of primitives */
  51.  
  52. #define TRUE        1
  53. #define FALSE        0
  54.  
  55. /*
  56.  * Used to make indices into bounding box arrays more readable.
  57.  */
  58. #define X    0
  59. #define Y    1
  60. #define Z    2
  61. #define LOW    0
  62. #define HIGH    1
  63.  
  64. /*
  65.  * Light source types
  66.  */
  67. #define LOCAL        (char)1
  68. #define DIRECTIONAL    (char)2
  69. #define EXTENDED    (char)3
  70.  
  71. /*
  72.  * Various useful constants and macros.
  73.  */
  74. #ifndef PI
  75. #define    PI        3.14159265358979323846
  76. #endif
  77. #define deg2rad(x)    (double)(PI * x / 180.)
  78. #define LNHALF        (-.69314718)
  79. /*
  80.  * Minimum vector length
  81.  */
  82. #define EPSILON        (double)0.00001
  83.  
  84. /*
  85.  * Maximum intersection-point distance.  (Making the "world" a sphere of radius
  86.  * FAR_AWAY centered at eyep.)
  87.  */
  88. #define FAR_AWAY        1.0E+14
  89.  
  90. /*
  91.  * Constants used in triangle & polygon intersection tests.
  92.  */
  93. #define XNORMAL        (char)0
  94. #define YNORMAL        (char)1
  95. #define ZNORMAL        (char)2
  96.  
  97. /*
  98.  * Constants for Stereo mode
  99.  */
  100. #define LEFT        1
  101. #define RIGHT        2
  102.  
  103. #ifndef NULL
  104. #    define NULL 0
  105. #endif
  106.  
  107. #define UNSET        -1
  108.