home *** CD-ROM | disk | FTP | other *** search
/ Chestnut's Multimedia Mania / MM_MANIA.ISO / graphics / povsrc20 / texture.h < prev    next >
C/C++ Source or Header  |  1993-07-08  |  2KB  |  58 lines

  1. /****************************************************************************
  2. *                   texture.h
  3. *
  4. *  This file contains defines and variables for the txt*.c files
  5. *
  6. *  from Persistence of Vision Raytracer
  7. *  Copyright 1993 Persistence of Vision Team
  8. *---------------------------------------------------------------------------
  9. *  NOTICE: This source code file is provided so that users may experiment
  10. *  with enhancements to POV-Ray and to port the software to platforms other 
  11. *  than those supported by the POV-Ray Team.  There are strict rules under
  12. *  which you are permitted to use this file.  The rules are in the file
  13. *  named POVLEGAL.DOC which should be distributed with this file. If 
  14. *  POVLEGAL.DOC is not available or for more info please contact the POV-Ray
  15. *  Team Coordinator by leaving a message in CompuServe's Graphics Developer's
  16. *  Forum.  The latest version of POV-Ray may be found there as well.
  17. *
  18. * This program is based on the popular DKB raytracer version 2.12.
  19. * DKBTrace was originally written by David K. Buck.
  20. * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
  21. *
  22. *****************************************************************************/
  23.  
  24. extern long Calls_To_Noise, Calls_To_DNoise;
  25.  
  26. #define MINX    -10000        /* Ridiculously large scaling values */
  27. #define MINY    MINX
  28. #define MINZ    MINX
  29.  
  30. #define MAXSIZE 267
  31. #define RNDMASK 0x7FFF
  32. #define RNDDIVISOR (DBL) RNDMASK
  33. #define NUMBER_OF_WAVES 10
  34. #define SINTABSIZE 1000
  35.  
  36. #define FLOOR(x) ((x) >= 0.0 ? floor(x) : (0.0 - floor(0.0 - (x)) - 1.0))
  37. #define FABS(x) ((x) < 0.0 ? (0.0 - x) : (x))
  38. #define SCURVE(a) ((a)*(a)*(3.0-2.0*(a)))
  39. #define REALSCALE ( 2.0 / 65535.0 )
  40. #define Hash3d(a,b,c) hashTable[(int)(hashTable[(int)(hashTable[(int)((a) & 0xfffL)] \
  41.                          ^ ((b) & 0xfffL))] ^ ((c) & 0xfffL))]
  42. #define Hash2d(a,b) hashTable[(int)(hashTable[(int)((a) & 0xfffL)] ^ ((b) & 0xfffL))]
  43. #define Hash1d(a,b) hashTable[(int)(a) ^ ((b) & 0xfffL)]  
  44. #define INCRSUM(m,s,x,y,z)    ((s)*(RTable[m]*0.5        \
  45.                     + RTable[m+1]*(x)    \
  46.                     + RTable[m+2]*(y)    \
  47.                     + RTable[m+3]*(z)))
  48.  
  49. #define INCRSUMP(mp,s,x,y,z) ((s)*((mp[0])*0.5 + (mp[1])*(x) + (mp[2])*(y) + (mp[3])*(z)))
  50.  
  51. extern int Options;
  52. extern DBL *sintab;
  53. extern DBL frequency[NUMBER_OF_WAVES];
  54. extern VECTOR Wave_Sources[NUMBER_OF_WAVES];
  55. extern DBL *RTable;
  56. extern short *hashTable;
  57. extern unsigned short crctab[256];
  58.