home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume21 / rayshade / part01 / src / constants.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-21  |  2.3 KB  |  106 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. #define    PI        3.14159265358979323846
  75. #define deg2rad(x)    (double)(PI * x / 180.)
  76. #define LNHALF        (-.69314718)
  77. /*
  78.  * Minimum vector length
  79.  */
  80. #define EPSILON        (double)0.00001
  81.  
  82. /*
  83.  * Maximum intersection-point distance.  (Making the "world" a sphere of radius
  84.  * FAR_AWAY centered at eyep.)
  85.  */
  86. #define FAR_AWAY        1.0E+14
  87.  
  88. /*
  89.  * Constants used in triangle & polygon intersection tests.
  90.  */
  91. #define XNORMAL        (char)0
  92. #define YNORMAL        (char)1
  93. #define ZNORMAL        (char)2
  94.  
  95. /*
  96.  * Constants for Stereo mode
  97.  */
  98. #define LEFT        1
  99. #define RIGHT        2
  100.  
  101. #ifndef NULL
  102. #    define NULL 0
  103. #endif
  104.  
  105. #define UNSET        -1
  106.