home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / RTrace 1.0 / source / textrace.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-06  |  3.0 KB  |  134 lines  |  [TEXT/KAHL]

  1. /*
  2.  * Copyright (c) 1992 Pedro Borges, Paulo Almeida, INESC-Norte.
  3.  * All rights reserved.
  4.  *
  5.  * This code received contributions from the following people:
  6.  *
  7.  *  Roman Kuchkuda      - basic ray tracer
  8.  *  Mark VandeWettering - MTV ray tracer
  9.  *  Augusto Sousa       - overall, shading model
  10.  *
  11.  * Redistribution and use in source and binary forms are permitted
  12.  * provided that the above copyright notice and this paragraph are
  13.  * duplicated in all such forms and that any documentation,
  14.  * advertising materials, and other materials related to such
  15.  * distribution and use acknowledge that the software was developed
  16.  * by Antonio Costa, at INESC-Norte. The name of the author and
  17.  * INESC-Norte may not be used to endorse or promote products derived
  18.  * from this software without specific prior written permission.
  19.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  20.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  21.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  22.  */
  23. #include <string.h>
  24. #include <stdio.h>
  25.  
  26. #ifdef THINK_C
  27. #include <stdlib.h>
  28. #include "defs.h"
  29. #include "extern.h"
  30. #else
  31. #include <malloc.h>
  32. #include "pp.h"
  33. #endif 
  34.  
  35. #include <ctype.h>
  36. #include "pp_ext.h"
  37.  
  38. /**********************************************************************
  39.  *    RAY TRACING - Version 7.3                                       *
  40.  *                                                                    *
  41.  *    MADE BY: Pedro Borges, Paulo Almeida, INESC-Norte, June 1992    *
  42.  *    MODIFIED BY: Antonio Costa, INESC-Norte, June 1992              *
  43.  **********************************************************************/
  44.  
  45. #ifdef __sgi
  46. #define __EXTENSIONS__
  47. #endif
  48.  
  49. #include <math.h>
  50. #ifndef M_PI
  51. #define M_PI 3.14159265358979323846
  52. #endif
  53.  
  54. #define new(t) (t *)alloc(sizeof(t))
  55. #define newa(t,s) (t *)alloc((s) * sizeof(t))
  56.  
  57. #define BIG 1.0e8
  58. #define TINY 1.0e-8
  59. #define PIS2 (M_PI / 2.0)
  60. #define REALCONV "%lf"
  61. #define NULSP -10000
  62. #define PSNAME '/'
  63. #define BUFFERSIZE 100
  64.  
  65. typedef
  66. struct
  67. {
  68.   xyz_struct      x_v, y_v, z_v;
  69. }               xyz_axes;
  70.  
  71. typedef
  72. struct
  73. {
  74.   real            x, y;
  75. }               xy_struct, *xy_ptr;
  76.  
  77. typedef
  78. struct
  79. {
  80.   xy_struct       p[3];
  81.   char            t;
  82. }               curve;
  83.  
  84. typedef
  85. struct
  86. {
  87.   int             n;
  88.   curve          *curve_arr;
  89. }               ccurve;
  90.  
  91. typedef
  92. struct
  93. {
  94.   real            bot, top, width;
  95.   int             n;
  96.   ccurve         *ccurve_arr;
  97. }               prismdsc;
  98.  
  99. typedef
  100. struct
  101. {
  102.   xyz_struct      position;
  103.   xyz_axes       *orient_ptr;
  104.   xyz_ptr         size_ptr;
  105.   int             ccint, cint, enter;
  106.   real            tint;
  107.   xyz_struct      dirint;
  108.   prismdsc       *prismdsc_ptr;
  109. }               prism;
  110.  
  111. typedef
  112. struct character
  113. {
  114.   struct character *next;
  115.   char           *name;
  116.   prismdsc       *prismdsc_ptr;
  117. }               character;
  118.  
  119. typedef
  120. struct font
  121. {
  122.   struct font    *next;
  123.   char           *name;
  124.   struct character *ch_ptr;
  125. }               font;
  126.  
  127. typedef
  128. struct code
  129. {
  130.   struct code    *next;
  131.   int             code;
  132.   char           *name;
  133. }               code;
  134.