home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume28 / rayshade / patch04 < prev    next >
Encoding:
Text File  |  1992-02-09  |  44.5 KB  |  1,462 lines

  1. Newsgroups: comp.sources.misc
  2. From: Craig Kolb <rayshade-request@cs.princeton.edu>
  3. Subject:  v28i030:  rayshade - A raytracing package for UNIX, Patch04
  4. Message-ID: <1992Feb10.162026.5810@sparky.imd.sterling.com>
  5. X-Md4-Signature: c0a893b6c041148a9801edd1aa2c3b24
  6. Date: Mon, 10 Feb 1992 16:20:26 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Craig Kolb <rayshade-request@cs.princeton.edu>
  10. Posting-number: Volume 28, Issue 30
  11. Archive-name: rayshade/patch04
  12. Environment: UNIX
  13. Patch-To: rayshade: Volume 21, Issue 3-22
  14.  
  15. System: rayshade version 4.0
  16. Patch #: 4
  17. Priority: HIGH
  18. Subject: patch #3, continued
  19. Date: Mon Feb  3 13:23:58 EST 1992
  20. From: Rayshade Construction Co. <rayshade-request@cs.princeton.edu>
  21.  
  22. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your rayshade source
  23.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  24.     If you don't have the patch program, apply the following by hand,
  25.     or get patch (version 2.0, latest patchlevel).
  26.  
  27.     After patching:
  28.         *** DO NOTHING--INSTALL ALL PATCHES UP THROUGH #5 FIRST ***
  29.  
  30.     If patch indicates that patchlevel is the wrong version, you may need
  31.     to apply one or more previous patches, or the patch may already
  32.     have been applied.  See the patchlevel.h file to find out what has or
  33.     has not been applied.  In any event, don't continue with the patch.
  34.  
  35.     If you are missing previous patches they can be obtained through
  36.     anonymous ftp from weedeater.math.yale.edu (130.132.23.17) in
  37.     pub/rayshade.4.0/patches.
  38.  
  39.  
  40. Index: patchlevel.h
  41. Prereq: 3
  42. 1c1
  43. < #define PATCHLEVEL 3
  44. ---
  45. > #define PATCHLEVEL 4
  46.  
  47. Index: Doc/Guide/options.tex
  48. *** old/Doc/Guide/options.tex    Mon Feb  3 12:50:02 1992
  49. --- new/Doc/Guide/options.tex    Fri Jan 17 10:29:14 1992
  50. ***************
  51. *** 1,12 ****
  52.   \chapter{Options}
  53.   
  54. ! This appendix describes the command-line arguments accepted by {\em rayshade}.
  55.   These options override defaults
  56.   as well as any values or flags given in the input file,
  57.   and are thus useful for generating test and other unusual, ``non-standard''
  58.   renderings.
  59.   
  60. ! The general form of a \rayshade command line is:
  61.   \begin{quote}
  62.   {\tt rayshade} [{\em Options}] [{\em filename}]
  63.   \end{quote}
  64. --- 1,12 ----
  65.   \chapter{Options}
  66.   
  67. ! This appendix describes the command-line arguments accepted by {\rayshade}.
  68.   These options override defaults
  69.   as well as any values or flags given in the input file,
  70.   and are thus useful for generating test and other unusual, ``non-standard''
  71.   renderings.
  72.   
  73. ! The general form of a {\rayshade} command line is:
  74.   \begin{quote}
  75.   {\tt rayshade} [{\em Options}] [{\em filename}]
  76.   \end{quote}
  77. ***************
  78. *** 20,26 ****
  79.   
  80.   Command-line options fall into two broad categories: those that set
  81.   numerical or other values and thus must be followed by further arguments,
  82. ! and those that simply turn features on and off.  {\em Rayshade}'s
  83.   convention is to denote the value-setting arguments using capital letters,
  84.   and feature-toggling arguments using lower-case letters.
  85.   
  86. --- 20,26 ----
  87.   
  88.   Command-line options fall into two broad categories: those that set
  89.   numerical or other values and thus must be followed by further arguments,
  90. ! and those that simply turn features on and off.  {\Rayshade}'s
  91.   convention is to denote the value-setting arguments using capital letters,
  92.   and feature-toggling arguments using lower-case letters.
  93.   
  94. ***************
  95. *** 46,52 ****
  96.       Continue an interrupted rendering.
  97.   \end{defkey}
  98.   When given, this option indicates that the image file being written
  99. ! to contains a partially-completed image.  \Rayshade will read the
  100.   image to determine the scanline from which to continue the rendering.
  101.   This option is only available with the Utah Raster Toolkit.
  102.   The {\tt -O} option must also be used.
  103. --- 46,52 ----
  104.       Continue an interrupted rendering.
  105.   \end{defkey}
  106.   When given, this option indicates that the image file being written
  107. ! to contains a partially-completed image.  {\Rayshade} will read the
  108.   image to determine the scanline from which to continue the rendering.
  109.   This option is only available with the Utah Raster Toolkit.
  110.   The {\tt -O} option must also be used.
  111. ***************
  112. *** 74,79 ****
  113. --- 74,87 ----
  114.   \end{defkey}
  115.   Overrides the value given using the {\tt report} keyword.
  116.   
  117. + \begin{defkey}{-f}{}
  118. +     Flip all computed polygon (and triangle) normals.
  119. + \end{defkey}
  120. + This option should be used when rendering polygons defined
  121. + by vertices given in {\em clockwise}
  122. + order, rather than counter-clockwise order as
  123. + expected by {\rayshade}.
  124.   \begin{defkey}{-G}{{\em gamma}}
  125.       Use given gamma correction exponent writing writing
  126.       color information to the image file.
  127. ***************
  128. *** 91,100 ****
  129.   \end{defkey}
  130.   
  131.   \begin{defkey}{-j}{}
  132. !     Use jittered sampling to perform antialiasing.
  133.   \end{defkey}
  134. - This option overrides the {\tt adaptive} keyword, if present,
  135. - in the input file.
  136.   
  137.   \begin{defkey}{-l}{}
  138.       Render the left stereo pair image.
  139. --- 99,107 ----
  140.   \end{defkey}
  141.   
  142.   \begin{defkey}{-j}{}
  143. !     Toggle the use of jittered sampling to perform antialiasing.
  144. !     If disabled, a fixed sampling pattern is used.
  145.   \end{defkey}
  146.   
  147.   \begin{defkey}{-l}{}
  148.       Render the left stereo pair image.
  149. ***************
  150. *** 129,144 ****
  151.       Toggle the effect of object opacity on shadows.
  152.   \end{defkey}
  153.   This option is equivalent to specifying {\tt shadowtransp}
  154. ! in the input file.  By default, \rayshade traces shadow
  155.   rays through non-opaque objects.
  156.   
  157. ! \begin{defkey}{-P}{}
  158.       Specify the options that should be passed to the C
  159.       preprocessor.
  160.   \end{defkey}
  161.   The C preprocessor, if available, is applied to all of the input
  162.   passed to {\em rayshade}.
  163.   \begin{defkey}{-p}{}
  164.       Perform preview-quality rendering.
  165.   \end{defkey}
  166. --- 136,151 ----
  167.       Toggle the effect of object opacity on shadows.
  168.   \end{defkey}
  169.   This option is equivalent to specifying {\tt shadowtransp}
  170. ! in the input file.  By default, {\rayshade} traces shadow
  171.   rays through non-opaque objects.
  172.   
  173. ! \begin{defkey}{-P}{{\em cpp-arguments}}
  174.       Specify the options that should be passed to the C
  175.       preprocessor.
  176.   \end{defkey}
  177.   The C preprocessor, if available, is applied to all of the input
  178.   passed to {\em rayshade}.
  179.   \begin{defkey}{-p}{}
  180.       Perform preview-quality rendering.
  181.   \end{defkey}
  182. ***************
  183. *** 168,174 ****
  184.   \begin{defkey}{-s}{}
  185.       Disable caching of  shadowing information.
  186.   \end{defkey}
  187. ! It should not be necessary to ever use this option.
  188.   
  189.   \begin{defkey}{-T}{{\em r g b}}
  190.       Set the contrast threshold in the three
  191. --- 175,181 ----
  192.   \begin{defkey}{-s}{}
  193.       Disable caching of  shadowing information.
  194.   \end{defkey}
  195. ! It should never be necessary to use this option.
  196.   
  197.   \begin{defkey}{-T}{{\em r g b}}
  198.       Set the contrast threshold in the three
  199. ***************
  200. *** 177,182 ****
  201. --- 184,197 ----
  202.   This option overrides any value given through the use of
  203.   the {\em contrast} keyword.
  204.   
  205. + \begin{defkey}{-u}{}
  206. +     Toggle the use of the C preprocessor.
  207. + \end{defkey}
  208. + {\Rayshade} usually feeds its input through a
  209. + C preprocessor if one is available on your system.
  210. + If this option is given, unadulterated input files will
  211. + be used.
  212.   \begin{defkey}{-V}{{\em    filename}}
  213.       Write verbose output to the named file.
  214.   \end{defkey}
  215. ***************
  216. *** 190,198 ****
  217.   selected and the objects defined to be included in the
  218.   report file.
  219.   
  220. ! \begin{defkey}{-W}{{\em minx miny maxx maxy}}
  221. !     Render the specified subwindow.  The parameters
  222. !     should fall between zero and one.
  223.   \end{defkey}
  224.   This option is provided to facilitate changing and/or examining a
  225.   small portion of an image without having to re-render the entire
  226. --- 205,219 ----
  227.   selected and the objects defined to be included in the
  228.   report file.
  229.   
  230. ! \begin{defkey}{-W}{{\em minx maxx miny maxy}}
  231. !     Render the specified window.
  232. ! \end{defkey}
  233. ! The window must be properly contained within the screen.  This
  234. ! option overrides any window specified using the {\em window} keyword
  235. ! in the input file.
  236. ! \begin{defkey}{-X}{{\em left right bottom top}}
  237. !     Crop the rendering window using the given normalized values.
  238.   \end{defkey}
  239.   This option is provided to facilitate changing and/or examining a
  240.   small portion of an image without having to re-render the entire
  241.  
  242. Index: etc/rsconvert/yacc.y
  243. Prereq: 4.0.1.1
  244. *** old/etc/rsconvert/yacc.y    Mon Feb  3 12:49:50 1992
  245. --- new/etc/rsconvert/yacc.y    Mon Feb  3 09:11:58 1992
  246. ***************
  247. *** 11,23 ****
  248.   /*                                        */
  249.   /* There is no warranty or other guarantee of fitness of this software       */
  250.   /* for any purpose.  It is provided solely "as is".               */
  251. ! /* $Id: yacc.y,v 4.0.1.1 91/09/28 20:44:09 cek Exp Locker: cek $ */
  252.   %{
  253.   #include <stdio.h>
  254.   #include "libcommon/common.h"
  255.   
  256. ! /*#define NEWLINE()    WriteString("\n")*/
  257. ! #define NEWLINE()    printf("\n")
  258.   #define LIST    0
  259.   #define GRID    1
  260.   char yyfilename[BUFSIZ];
  261. --- 11,23 ----
  262.   /*                                        */
  263.   /* There is no warranty or other guarantee of fitness of this software       */
  264.   /* for any purpose.  It is provided solely "as is".               */
  265. ! /* $Id: yacc.y,v 4.0.1.2 91/11/26 21:13:36 cek Exp cek $ */
  266.   %{
  267.   #include <stdio.h>
  268.   #include "libcommon/common.h"
  269.   
  270. ! #define NEWLINE()    WriteNewline()
  271. ! /*#define NEWLINE()    printf("\n")*/
  272.   #define LIST    0
  273.   #define GRID    1
  274.   char yyfilename[BUFSIZ];
  275. ***************
  276. *** 31,42 ****
  277.       Vector v;
  278.   };
  279.   %token <d> tFLOAT
  280. ! %token <c> tSTRING
  281.   %token <i> tINT
  282.   %type <d> Fnumber sFnumber
  283.   %type <col> sColor
  284.   %type <v> sVector
  285. ! %token tADAPTIVE tAPERTURE 
  286.   %token tBACKGROUND tBLOTCH tBOX tBUMP tCONE tCYL tDIRECTIONAL
  287.   %token tENDDEF tEXTENDED tEYEP tFBM tFBMBUMP tFOCALDIST tFOG tFOV tGLOSS tGRID
  288.   %token tHEIGHTFIELD tJITTERED tLIGHT tLIST tLOOKP tMARBLE tMAXDEPTH tMIST
  289. --- 31,42 ----
  290.       Vector v;
  291.   };
  292.   %token <d> tFLOAT
  293. ! %token <c> tSTRING tHASHTHING
  294.   %token <i> tINT
  295.   %type <d> Fnumber sFnumber
  296.   %type <col> sColor
  297.   %type <v> sVector
  298. ! %token tADAPTIVE tAPERTURE
  299.   %token tBACKGROUND tBLOTCH tBOX tBUMP tCONE tCYL tDIRECTIONAL
  300.   %token tENDDEF tEXTENDED tEYEP tFBM tFBMBUMP tFOCALDIST tFOG tFOV tGLOSS tGRID
  301.   %token tHEIGHTFIELD tJITTERED tLIGHT tLIST tLOOKP tMARBLE tMAXDEPTH tMIST
  302. ***************
  303. *** 73,80 ****
  304. --- 73,87 ----
  305.           | Object
  306.           | Fog
  307.           | Mist
  308. +         | Hashthing
  309.           | ENDFILE        /* For backward compatibility */
  310.           ;
  311. + Hashthing    : tHASHTHING
  312. +         {
  313. +             WriteVerbatim("\n#");
  314. +             WriteVerbatim($1);
  315. +             WriteNewline();
  316. +         };
  317.   List        : LIST
  318.           {
  319.               NEWLINE();
  320. ***************
  321. *** 156,162 ****
  322.           {
  323.               NEWLINE();
  324.           }
  325. !         | FBM Fnumber Fnumber Fnumber Fnumber Int Fnumber tSTRING
  326.           {
  327.               NEWLINE();
  328.           }
  329. --- 163,169 ----
  330.           {
  331.               NEWLINE();
  332.           }
  333. !         | FBM Fnumber Fnumber Fnumber Fnumber Int Fnumber String
  334.           {
  335.               NEWLINE();
  336.           }
  337. ***************
  338. *** 401,406 ****
  339. --- 408,414 ----
  340.                   WriteFloat($10);
  341.                   WriteString("1 1 1");
  342.                   WriteFloat($11);
  343. +                 WriteNewline();
  344.               }
  345.           }
  346.           ;
  347. ***************
  348. *** 434,444 ****
  349. --- 442,466 ----
  350.           ;
  351.   Cylinder    : CYL String sVector sVector sFnumber
  352.           {
  353. +             Vector tmp;
  354.               /* Radius now goes first */
  355.               WriteFloat($5);
  356.               WriteVector(&$3);
  357.               WriteVector(&$4);
  358.               NEWLINE();
  359. +             WriteString("#ifdef ENDCAPS\n");
  360. +                 VecSub($3, $4, &tmp);
  361. +                 WriteVerbatim("disc ");
  362. +                 WriteFloat($5);    /* radius */
  363. +                 WriteVector(&$3); /* pos */
  364. +                 WriteVector(&tmp);
  365. +                 WriteVerbatim("\ndisc ");
  366. +                 VecScale(-1, tmp, &tmp);
  367. +                 WriteFloat($5);    /* radius */
  368. +                 WriteVector(&$4); /* pos */
  369. +                 WriteVector(&tmp);
  370. +             WriteString("\n#endif\n");
  371.           }
  372.           ;
  373.   Sphere        : SPHERE String Fnumber Vector
  374. ***************
  375. *** 495,502 ****
  376.               NEWLINE();
  377.           }
  378.           ;
  379. ! Fog        : FOG Fnumber Color
  380.           {
  381.               NEWLINE();
  382.           }
  383.           ;
  384. --- 517,526 ----
  385.               NEWLINE();
  386.           }
  387.           ;
  388. ! Fog        : FOG sFnumber sColor
  389.           {
  390. +             WriteColor(&$3);
  391. +             WriteFloat($2); WriteFloat($2); WriteFloat($2);
  392.               NEWLINE();
  393.           }
  394.           ;
  395. ***************
  396. *** 542,548 ****
  397.   FBM        : tFBM        { WriteString("fbm"); }
  398.   FBMBUMP        : tFBMBUMP    { WriteString("fbmbump"); }
  399.   FOCALDIST    : tFOCALDIST    { WriteString("focaldist"); }
  400. ! FOG        : tFOG        { WriteString("fog"); }
  401.   FOV        : tFOV        { WriteString("fov"); }
  402.   GLOSS        : tGLOSS    { WriteString("gloss"); }
  403.   GRID        : tGRID    tINT tINT tINT    { SetTypeGrid($2,$3,$4); }
  404. --- 566,572 ----
  405.   FBM        : tFBM        { WriteString("fbm"); }
  406.   FBMBUMP        : tFBMBUMP    { WriteString("fbmbump"); }
  407.   FOCALDIST    : tFOCALDIST    { WriteString("focaldist"); }
  408. ! FOG        : tFOG        { WriteString("atmosphere fog"); }
  409.   FOV        : tFOV        { WriteString("fov"); }
  410.   GLOSS        : tGLOSS    { WriteString("gloss"); }
  411.   GRID        : tGRID    tINT tINT tINT    { SetTypeGrid($2,$3,$4); }
  412. ***************
  413. *** 553,559 ****
  414.   LOOKP        : tLOOKP    { WriteString("lookp"); }
  415.   MARBLE        : tMARBLE    { WriteString("marble"); }
  416.   MAXDEPTH    : tMAXDEPTH    { WriteString("maxdepth"); }
  417. ! MIST        : tMIST        { WriteString("mist"); }
  418.   OBJECT        : tOBJECT    { WriteString("object"); }
  419.   OUTFILE        : tOUTFILE    { WriteString("outfile"); }
  420.   PLANE        : tPLANE    { WriteString("plane"); }
  421. --- 577,583 ----
  422.   LOOKP        : tLOOKP    { WriteString("lookp"); }
  423.   MARBLE        : tMARBLE    { WriteString("marble"); }
  424.   MAXDEPTH    : tMAXDEPTH    { WriteString("maxdepth"); }
  425. ! MIST        : tMIST        { WriteString("atmosphere mist"); }
  426.   OBJECT        : tOBJECT    { WriteString("object"); }
  427.   OUTFILE        : tOUTFILE    { WriteString("outfile"); }
  428.   PLANE        : tPLANE    { WriteString("plane"); }
  429.  
  430.  
  431. Index: libshade/yacc.y
  432. Prereq: 4.0.1.2
  433. *** old/libshade/yacc.y    Mon Feb  3 12:49:51 1992
  434. --- new/libshade/yacc.y    Fri Jan 17 10:30:13 1992
  435. ***************
  436. *** 11,17 ****
  437.   /*                                        */
  438.   /* There is no warranty or other guarantee of fitness of this software       */
  439.   /* for any purpose.  It is provided solely "as is".               */
  440. ! /* $Id: yacc.y,v 4.0.1.2 91/10/08 20:40:35 cek Exp Locker: cek $ */
  441.   %{
  442.   #include "rayshade.h"
  443.   
  444. --- 11,17 ----
  445.   /*                                        */
  446.   /* There is no warranty or other guarantee of fitness of this software       */
  447.   /* for any purpose.  It is provided solely "as is".               */
  448. ! /* $Id: yacc.y,v 4.0.1.4 92/01/10 16:29:55 cek Exp Locker: cek $ */
  449.   %{
  450.   #include "rayshade.h"
  451.   
  452. ***************
  453. *** 514,519 ****
  454. --- 514,520 ----
  455.                   AnimExpr AnimExpr AnimExpr
  456.                   AnimExpr AnimExpr AnimExpr
  457.           {
  458. +             $$ = TransXformCreate();
  459.               TransXformSetX0($$, $2);
  460.               TransXformSetY0($$, $3);
  461.               TransXformSetZ0($$, $4);
  462. ***************
  463. *** 648,653 ****
  464. --- 649,659 ----
  465.                   Options.window[HIGH][X] = $3;
  466.                   Options.window[LOW][Y] = $4;
  467.                   Options.window[HIGH][Y] = $5;
  468. +                 /*
  469. +                  * We must let ViewingSetup know
  470. +                  * that a window has been defined.
  471. +                  */
  472. +                 Options.window_set = TRUE;
  473.               }
  474.           }
  475.           ;
  476. ***************
  477. *** 1002,1007 ****
  478. --- 1008,1015 ----
  479.               Defstack = GeomStackPop(Defstack);
  480.               /* Pop current surface */
  481.               CurSurf = SurfPop(CurSurf);
  482. +             /* Make current default surf aggregate's default */
  483. +             $$->surf = CurSurf->surf;
  484.           }
  485.           ;
  486.   AggregateDef    : AggregateCreate Aggdefs tEND
  487.  
  488. Index: rayview/glmethods.c
  489. Prereq: 4.0.1.2
  490. *** old/rayview/glmethods.c    Mon Feb  3 12:49:50 1992
  491. --- new/rayview/glmethods.c    Fri Jan 17 10:30:33 1992
  492. ***************
  493. *** 14,22 ****
  494.    * There is no warranty or other guarantee of fitness of this software
  495.    * for any purpose.  It is provided solely "as is".
  496.    *
  497. !  * $Id: glmethods.c,v 4.0.1.2 91/10/10 22:45:27 cek Exp $
  498.    *
  499.    * $Log:    glmethods.c,v $
  500.    * Revision 4.0.1.2  91/10/10  22:45:27  cek
  501.    * patch1: Added spotlight support.
  502.    * 
  503. --- 14,29 ----
  504.    * There is no warranty or other guarantee of fitness of this software
  505.    * for any purpose.  It is provided solely "as is".
  506.    *
  507. !  * $Id: glmethods.c,v 4.0.1.4 92/01/10 17:17:39 cek Exp Locker: cek $
  508.    *
  509.    * $Log:    glmethods.c,v $
  510. +  * Revision 4.0.1.4  92/01/10  17:17:39  cek
  511. +  * patch3: Added heightfield support.
  512. +  * 
  513. +  * Revision 4.0.1.3  91/12/13  11:43:11  cek
  514. +  * patch3: Spot direction and spread now set correctly.
  515. +  * patch3: Set GLC_OLDPOLYGON to 0 on sgi machines to fix VGX weirdness.
  516. +  * 
  517.    * Revision 4.0.1.2  91/10/10  22:45:27  cek
  518.    * patch1: Added spotlight support.
  519.    * 
  520. ***************
  521. *** 40,45 ****
  522. --- 47,53 ----
  523.   #include "libobj/csg.h"
  524.   #include "libobj/cylinder.h"
  525.   #include "libobj/disc.h"
  526. + #include "libobj/hf.h"
  527.   #include "libobj/grid.h"
  528.   #include "libobj/instance.h"
  529.   #include "libobj/list.h"
  530. ***************
  531. *** 117,123 ****
  532.       CylinderMethodRegister(GLCylinderDraw);
  533.       DiscMethodRegister(GLDiscDraw);
  534.       GridMethodRegister(GLGridDraw);
  535. !     /*HfMethodRegister(GLHfDraw);*/
  536.       InstanceMethodRegister(GLInstanceDraw);
  537.       ListMethodRegister(GLListDraw);
  538.       PlaneMethodRegister(GLPlaneDraw);
  539. --- 125,133 ----
  540.       CylinderMethodRegister(GLCylinderDraw);
  541.       DiscMethodRegister(GLDiscDraw);
  542.       GridMethodRegister(GLGridDraw);
  543. ! #ifdef sgi
  544. !     HfMethodRegister(GLHfDraw);
  545. ! #endif
  546.       InstanceMethodRegister(GLInstanceDraw);
  547.       ListMethodRegister(GLListDraw);
  548.       PlaneMethodRegister(GLPlaneDraw);
  549. ***************
  550. *** 186,191 ****
  551. --- 196,202 ----
  552.       ScreenDrawInit();
  553.       ObjectInit();
  554.       LightDrawInit();
  555.       /*
  556.        * Push the default surface.
  557.        */
  558. ***************
  559. *** 203,208 ****
  560. --- 214,224 ----
  561.   #endif
  562.       prefsize(Screen.xsize, Screen.ysize);
  563.       winopen("rayview");
  564. + #ifdef sgi
  565. +     glcompat(GLC_OLDPOLYGON, 0);
  566. + #endif
  567.       RGBmode();
  568.       mmode(MVIEWING);
  569.   
  570. ***************
  571. *** 214,226 ****
  572.   
  573.       gconfig();
  574.       blendfunction(BF_SA, BF_MSA);
  575.       /*
  576.        * Initialize viewing matrix.
  577.        */
  578.       GLViewingInit();
  579.   
  580. -     zbuffer(TRUE);
  581.       BackPack = (unsigned char)(255*Screen.background.r) |
  582.           ((unsigned char)(255*Screen.background.g) << 8) |
  583.           ((unsigned char)(255*Screen.background.b) << 16);
  584. --- 230,242 ----
  585.   
  586.       gconfig();
  587.       blendfunction(BF_SA, BF_MSA);
  588. +     zbuffer(TRUE);
  589.       /*
  590.        * Initialize viewing matrix.
  591.        */
  592.       GLViewingInit();
  593.   
  594.       BackPack = (unsigned char)(255*Screen.background.r) |
  595.           ((unsigned char)(255*Screen.background.g) << 8) |
  596.           ((unsigned char)(255*Screen.background.b) << 16);
  597. ***************
  598. *** 564,570 ****
  599.   }
  600.   
  601.   static void
  602. ! GLHfDraw(){}
  603.   
  604.   static void
  605.   GLInstanceDraw(inst)
  606. --- 580,653 ----
  607.   }
  608.   
  609.   static void
  610. ! GLHfDraw(hf)
  611. ! Hf *hf;
  612. ! {
  613. !     int x, y;
  614. !     float n[3], v[3], del, del2, del4, dz1, delz, za, zb, zc;
  615. !     float bot, top, left, right, len;
  616. !     del = 1. / (hf->size - 1);
  617. !     del2 = del*del;
  618. !     del4 = del2*del2;
  619. !     bot = 0.;
  620. !     top = del;
  621. !     for (y = 0; y < hf->size -1; y++) {
  622. !         za = hf->data[y+1][0];
  623. !         zb = hf->data[y][0];
  624. !         left = 0;
  625. !         right = del;
  626. !         for (x = 1; x < hf->size; x++) {
  627. !             /*
  628. !              * A +-+ C
  629. !              *   |/
  630. !              * B +
  631. !              */
  632. !         
  633. !             zc = hf->data[y+1][x];
  634. !             dz1 = za - zb;
  635. !             delz = za - zc;
  636. !             len = sqrt(del2*delz*delz + del2*dz1*dz1 + del4);
  637. !             bgnpolygon();
  638. !             n[0] = del*delz/len;
  639. !             n[1] = -del*dz1/len;
  640. !             n[2] = del2/len;
  641. !             n3f(n);
  642. !             v[0] = left; v[1] = top; v[2] = za; v3f(v);
  643. !             v[1] = bot; v[2] = zb; v3f(v);
  644. !             v[0] = right; v[1] = top; v[2] = zc; v3f(v);
  645. !             endpolygon();
  646. !             /*
  647. !              *   B +
  648. !              *    /|
  649. !              * A +-+ C
  650. !              */
  651. !             za = zb; zb = zc; zc = hf->data[y][x];
  652. !             dz1 = zc - za;
  653. !             delz = zc - zb;
  654. !             len = sqrt(del2*dz1*dz1 + del2*delz*delz + del4);
  655. !             n[0] = -del*dz1/len;
  656. !             n[1] = del*delz/len;
  657. !             n[2] = del2/len;
  658. !             bgnpolygon();
  659. !             n3f(n);
  660. !             v[0] = left; v[1] = bot; v[2] = za; v3f(v);
  661. !             v[0] = right; v[2] = zc; v3f(v);
  662. !             v[1] = top; v[2] = zb; v3f(v);
  663. !             endpolygon();
  664. !             left = right;
  665. !             right += del;
  666. !             za = zb;
  667. !             zb = zc;
  668. !         }
  669. !         bot = top;
  670. !         top += del;
  671. !     }
  672. !     
  673. ! }
  674.   
  675.   static void
  676.   GLInstanceDraw(inst)
  677. ***************
  678. *** 762,774 ****
  679.       lpos[1] = spot->pos.y;
  680.       lpos[2] = spot->pos.z;
  681.       lpos[3] = 1.;
  682. !     spotdir[0] = spot->pos.x - spot->dir.x;
  683. !     spotdir[1] = spot->pos.y - spot->dir.y;
  684. !     spotdir[2] = spot->pos.z - spot->dir.z;
  685.       *spotexp = spot->coef;
  686. !     *spotspread = spot->falloff;
  687.       lmdef(DEFLIGHT, curlight++, sizeof(lightprops) / sizeof(float),
  688.               lightprops);
  689.       *spotspread = 180.;
  690.       *spotexp = 1.;
  691.   }
  692. --- 845,858 ----
  693.       lpos[1] = spot->pos.y;
  694.       lpos[2] = spot->pos.z;
  695.       lpos[3] = 1.;
  696. !     spotdir[0] = spot->dir.x;
  697. !     spotdir[1] = spot->dir.y;
  698. !     spotdir[2] = spot->dir.z;
  699.       *spotexp = spot->coef;
  700. !     *spotspread = 180 * acos(spot->falloff) / PI;
  701.       lmdef(DEFLIGHT, curlight++, sizeof(lightprops) / sizeof(float),
  702.               lightprops);
  703. +     /* fix up spot defs so other source methods needn't reset them. */
  704.       *spotspread = 180.;
  705.       *spotexp = 1.;
  706.   }
  707.  
  708. Index: README
  709. *** old/README    Mon Feb  3 12:49:52 1992
  710. --- new/README    Fri Jan 17 10:29:21 1992
  711. ***************
  712. *** 35,41 ****
  713.   conversion utility, rsconvert.  See Doc/Changes for a list of some of
  714.   the more important changes.
  715.   
  716. ! Rayshade v4.0 Beta has been tested on several different UNIX-based computers,
  717.   including: SGI 4D, IBM RS6000, Sun Sparcstation 1, Sun 3, DECstation,
  718.   Apollo DN10000, NeXT.  If your machine has a C compiler, enough memory
  719.   (at least 2Mb), and runs something resembling UNIX, rayshade should be fairly
  720. --- 35,41 ----
  721.   conversion utility, rsconvert.  See Doc/Changes for a list of some of
  722.   the more important changes.
  723.   
  724. ! Rayshade v4.0 has been tested on many different UNIX-based computers,
  725.   including: SGI 4D, IBM RS6000, Sun Sparcstation 1, Sun 3, DECstation,
  726.   Apollo DN10000, NeXT.  If your machine has a C compiler, enough memory
  727.   (at least 2Mb), and runs something resembling UNIX, rayshade should be fairly
  728. ***************
  729. *** 54,60 ****
  730.   
  731.   Normally, rayshade makes use of the Utah Raster toolkit.  You are
  732.   strongly encouraged to get a copy of the toolkit, as it provides a
  733. ! host of useful tools for image manipulation and a library for reading/reading
  734.   the toolkit's "RLE" format image files.  "blurb.urt" is the "blurb" file from
  735.   the latest distribution of the toolkit.  Also of interest is the
  736.   "fbm" library, available from nl.cs.cmu.edu:/usr/mlm/ftp/fbm.tar.Z, which
  737. --- 54,60 ----
  738.   
  739.   Normally, rayshade makes use of the Utah Raster toolkit.  You are
  740.   strongly encouraged to get a copy of the toolkit, as it provides a
  741. ! host of useful tools for image manipulation and a library for reading/writing
  742.   the toolkit's "RLE" format image files.  "blurb.urt" is the "blurb" file from
  743.   the latest distribution of the toolkit.  Also of interest is the
  744.   "fbm" library, available from nl.cs.cmu.edu:/usr/mlm/ftp/fbm.tar.Z, which
  745. ***************
  746. *** 140,147 ****
  747.   William Bouma, Allen Braunsdorf, Jeff Butterworth, Nick Carriero,
  748.   Nancy Everson, Tom Friedel, Robert Funchess, David Gelernter, Mike Gigante,
  749.   Ed Herderick, John Knuston, Raphael Manfredi, Lee Moore, Dietmar Saupe,
  750. ! Brian Wyvill, and everybody else for their bugfixes, suggestions, input files,
  751. ! encouragement, and other feedback.
  752.   
  753.   Thanks also to Mark Podlipec for providing the blob and torus objects.
  754.   
  755. --- 140,147 ----
  756.   William Bouma, Allen Braunsdorf, Jeff Butterworth, Nick Carriero,
  757.   Nancy Everson, Tom Friedel, Robert Funchess, David Gelernter, Mike Gigante,
  758.   Ed Herderick, John Knuston, Raphael Manfredi, Lee Moore, Dietmar Saupe,
  759. ! Iain Sinclair, Brian Wyvill, and everybody else for their bugfixes,
  760. ! suggestions, input files, encouragement, and other feedback.
  761.   
  762.   Thanks also to Mark Podlipec for providing the blob and torus objects.
  763.   
  764. ***************
  765. *** 149,155 ****
  766.   His code, and a host of other useful routines, can be found in
  767.   "Graphics Gems", edited by Andrew Glassner.
  768.   
  769. ! Thanks to Benoit Mandelbrot for his support and inspiration.
  770.   
  771.   If you find any bugs, make any useful extensions, have a nice input file,
  772.   port rayshade to a new environment, or need assistance understanding a
  773. --- 149,155 ----
  774.   His code, and a host of other useful routines, can be found in
  775.   "Graphics Gems", edited by Andrew Glassner.
  776.   
  777. ! Thanks to Benoit Mandelbrot for the support he provided this project.
  778.   
  779.   If you find any bugs, make any useful extensions, have a nice input file,
  780.   port rayshade to a new environment, or need assistance understanding a
  781. ***************
  782. *** 162,169 ****
  783.   
  784.   Craig Kolb
  785.   Rod Bogart
  786. ! 9 October 1991
  787. ! rayshade@weedeater.math.yale.edu
  788.   
  789.   Craig Kolb 
  790.   Computer Science Department
  791. --- 162,169 ----
  792.   
  793.   Craig Kolb
  794.   Rod Bogart
  795. ! 10 January 1992
  796. ! rayshade-request@cs.yale.edu
  797.   
  798.   Craig Kolb 
  799.   Computer Science Department
  800.  
  801.  
  802. Index: raypaint/README
  803. *** old/raypaint/README    Mon Feb  3 12:42:23 1992
  804. --- new/raypaint/README    Fri Jan 17 10:30:23 1992
  805. ***************
  806. *** 17,26 ****
  807.   
  808.   The middle mouse button may be used to sweep out a rectangular region to
  809.   which raypaint should restrict its refinement:  Press and hold the middle
  810. ! mouse button while pointing at one corner of the region on interest,
  811.   drag the cursor to the opposite corner and release the mouse button.
  812.   Note that no rectangle will be drawn.  Refinement will continue inside
  813. ! of the indicated region, using whatever sampling
  814.   
  815.   When every pixel has been sampled, an image file is written.
  816.   
  817. --- 17,26 ----
  818.   
  819.   The middle mouse button may be used to sweep out a rectangular region to
  820.   which raypaint should restrict its refinement:  Press and hold the middle
  821. ! mouse button while pointing at one corner of the region of interest,
  822.   drag the cursor to the opposite corner and release the mouse button.
  823.   Note that no rectangle will be drawn.  Refinement will continue inside
  824. ! of the indicated region.
  825.   
  826.   When every pixel has been sampled, an image file is written.
  827.   
  828.  
  829. Index: etc/rsconvert/lex.l
  830. Prereq: 4.0
  831. *** old/etc/rsconvert/lex.l    Mon Feb  3 12:42:44 1992
  832. --- new/etc/rsconvert/lex.l    Fri Jan 17 10:29:21 1992
  833. ***************
  834. *** 10,16 ****
  835.   /*                                        */
  836.   /* There is no warranty or other guarantee of fitness of this software       */
  837.   /* for any purpose.  It is provided solely "as is".               */
  838. ! /* $Id: lex.l,v 4.0 91/07/17 14:29:16 kolb Exp Locker: kolb $ */
  839.   %{
  840.   #include "config.h"
  841.   #include <stdio.h>
  842. --- 10,16 ----
  843.   /*                                        */
  844.   /* There is no warranty or other guarantee of fitness of this software       */
  845.   /* for any purpose.  It is provided solely "as is".               */
  846. ! /* $Id: lex.l,v 4.0.1.1 91/11/26 21:12:29 cek Exp Locker: cek $ */
  847.   %{
  848.   #include "config.h"
  849.   #include <stdio.h>
  850. ***************
  851. *** 29,37 ****
  852.   string    ({alpha}|"/")({alpha}|{digit}|{special}|"/")*
  853.   %p 3000
  854.   %%
  855. ! [\t\n]            {WriteVerbatim(yytext);};
  856.   " "            {};
  857. ! ^#            {handlehash();}
  858.   "/*"            {skipcomments();}
  859.   adaptive        {return(tADAPTIVE);}
  860.   aperture        {return(tAPERTURE);}
  861. --- 29,38 ----
  862.   string    ({alpha}|"/")({alpha}|{digit}|{special}|"/")*
  863.   %p 3000
  864.   %%
  865. ! [\t]            {WriteVerbatim(yytext);};
  866. ! "\n"            {};
  867.   " "            {};
  868. ! ^#            {return handlehash();}
  869.   "/*"            {skipcomments();}
  870.   adaptive        {return(tADAPTIVE);}
  871.   aperture        {return(tAPERTURE);}
  872. ***************
  873. *** 111,116 ****
  874. --- 112,118 ----
  875.           WriteChar(c);
  876.           if ((c = input()) == '/') {
  877.               WriteChar(c);
  878. +             WriteNewline();
  879.               return;
  880.           }
  881.           unput(c);
  882. ***************
  883. *** 127,133 ****
  884.   handlehash()
  885.   {
  886.       char buf[BUFSIZ];
  887. !     int i;
  888.       extern int yylineno;
  889.       extern char yyfilename[];
  890.   
  891. --- 129,135 ----
  892.   handlehash()
  893.   {
  894.       char buf[BUFSIZ];
  895. !     int i, linenumber;
  896.       extern int yylineno;
  897.       extern char yyfilename[];
  898.   
  899. ***************
  900. *** 139,162 ****
  901.       unput(buf[i]);        /* To make sure consecutive # lines work. */
  902.       buf[i] = (char)NULL;    /* Replace newline with NULL. */
  903.   
  904. !     /*
  905. !      * Check to see if it's #include or
  906. !      * #define.
  907. !      * If so just spit out the line.
  908. !      */
  909. !     if (strncmp("include", buf, 7) == 0 || strncmp("define", buf, 6) == 0) {
  910. !         WriteVerbatim("#");
  911. !         WriteVerbatim(buf);
  912. !         return;
  913. !     }
  914.       /*
  915. !      * Complain if the line was not of the form #n "filename"
  916.        */
  917. !     if ((i = sscanf(buf, "%d \"%[^\"]s\"", &yylineno, yyfilename)) == 0) {
  918. !         yyerror("Unknown '#' control.");
  919. !         exit(1);
  920. !     }
  921. !     if (i == 1) {
  922.   #ifdef SYSV
  923.           if (strchr(buf, '"') != (char *)0) {
  924.   #else
  925. --- 141,153 ----
  926.       unput(buf[i]);        /* To make sure consecutive # lines work. */
  927.       buf[i] = (char)NULL;    /* Replace newline with NULL. */
  928.   
  929. !     yylval.c = strsave(buf);
  930.       /*
  931. !      * Set file/line if the line was of the form #n "filename"
  932.        */
  933. !     if ((i = sscanf(buf, "%d \"%[^\"]s\"", &linenumber, buf)) != 0) {
  934. !         yylineno = linenumber;
  935.   #ifdef SYSV
  936.           if (strchr(buf, '"') != (char *)0) {
  937.   #else
  938. ***************
  939. *** 166,171 ****
  940.                * Filename was "", which means stdin.
  941.                */
  942.               strcpy(yyfilename, "stdin");
  943. !         }
  944.       }
  945.   }
  946. --- 157,164 ----
  947.                * Filename was "", which means stdin.
  948.                */
  949.               strcpy(yyfilename, "stdin");
  950. !         } else
  951. !             strcpy(yyfilename, buf);
  952.       }
  953. +     return tHASHTHING;
  954.   }
  955.  
  956.  
  957. Index: libshade/lex.l
  958. Prereq: 4.0.1.2
  959. *** old/libshade/lex.l    Mon Feb  3 12:49:59 1992
  960. --- new/libshade/lex.l    Fri Jan 17 10:30:08 1992
  961. ***************
  962. *** 11,17 ****
  963.   /* There is no warranty or other guarantee of fitness of this software       */
  964.   /* for any purpose.  It is provided solely "as is".               */
  965.   /*                                       */
  966. ! /* $Id: lex.l,v 4.0.1.2 91/10/08 20:25:59 cek Exp Locker: cek $ */
  967.   %{
  968.   #include "config.h"
  969.   #include "rayshade.h"
  970. --- 11,17 ----
  971.   /* There is no warranty or other guarantee of fitness of this software       */
  972.   /* for any purpose.  It is provided solely "as is".               */
  973.   /*                                       */
  974. ! /* $Id: lex.l,v 4.0.1.3 92/01/14 18:28:38 cek Exp Locker: cek $ */
  975.   %{
  976.   #include "config.h"
  977.   #include "rayshade.h"
  978. ***************
  979. *** 201,217 ****
  980.       /*
  981.        * Complain if the line was not of the form #n "filename"
  982.        */
  983. !     if ((i = sscanf(buf, "%d \"%[^\"]s\"", &yylineno, yyfilename)) == 0) {
  984. !         RLerror(RL_PANIC, "Unknown '#' control (%s).",buf);
  985.           exit(1);
  986.       }
  987. !     if (i == 1) {
  988. !         if (index(buf, '"') != (char *)NULL) {
  989. !             /*
  990. !              * Filename was "", which means stdin.
  991. !              */
  992. !             (void)strcpy(yyfilename, "stdin");
  993. !         }
  994.       }
  995.       yylineno--;  /* The newline we unput will increment yylineno */
  996.   }
  997. --- 201,216 ----
  998.       /*
  999.        * Complain if the line was not of the form #n "filename"
  1000.        */
  1001. !     if ((i = sscanf(buf,"%d \"%[^\"]s\"", &yylineno, yyfilename)) == 0 &&
  1002. !         (i = sscanf(buf," line %d \"%[^\"]s\"",&yylineno,yyfilename))==0) {
  1003. !         RLerror(RL_PANIC, "Unknown '#' control (%s).\n",buf);
  1004.           exit(1);
  1005.       }
  1006. !     if (i == 1 && (index(buf,'"') != (char *)NULL)) {
  1007. !         /*
  1008. !          * Filename was given as ""
  1009. !          */
  1010. !         (void)strcpy(yyfilename, "stdin");
  1011.       }
  1012.       yylineno--;  /* The newline we unput will increment yylineno */
  1013.   }
  1014.  
  1015. Index: Doc/Guide/animate.tex
  1016. *** old/Doc/Guide/animate.tex    Mon Feb  3 12:49:57 1992
  1017. --- new/Doc/Guide/animate.tex    Fri Jan 17 10:29:12 1992
  1018. ***************
  1019. *** 1,6 ****
  1020.   \chapter{Animation}
  1021.   
  1022. ! \Rayshade provides basic animation animation support by
  1023.   allowing time-varying
  1024.   transformations to be associated with primitives and aggregate objects.
  1025.   Commands are provided for controlling the amount of time between each
  1026. --- 1,6 ----
  1027.   \chapter{Animation}
  1028.   
  1029. ! {\Rayshade}\ provides basic animation animation support by
  1030.   allowing time-varying
  1031.   transformations to be associated with primitives and aggregate objects.
  1032.   Commands are provided for controlling the amount of time between each
  1033. ***************
  1034. *** 7,15 ****
  1035.   frame, the speed of the camera shutter, and the total number of frames
  1036.   to be rendered.
  1037.   
  1038. ! By default, rayshade renders a single frame, with the shutter open for
  1039.   an instant (0 units of time, in fact).  The shutter speed in no way
  1040. ! changes the light-gathering properties of the camera, i.e. frames
  1041.   rendered using
  1042.   a longer exposure will not appear brighter than those with a shorter
  1043.   exposure.  The only change will be in the potential amount of movement
  1044. --- 7,15 ----
  1045.   frame, the speed of the camera shutter, and the total number of frames
  1046.   to be rendered.
  1047.   
  1048. ! By default, {\rayshade} renders a single frame, with the shutter open for
  1049.   an instant (0 units of time, in fact).  The shutter speed in no way
  1050. ! changes the light-gathering properties of the camera, i.e., frames
  1051.   rendered using
  1052.   a longer exposure will not appear brighter than those with a shorter
  1053.   exposure.  The only change will be in the potential amount of movement
  1054. ***************
  1055. *** 16,22 ****
  1056.   that the
  1057.   frame ``sees'' during the time that the shutter is open.
  1058.   
  1059. ! Each ray cast by \rayshade samples a particular moment in time.
  1060.   The time value assigned to a ray
  1061.   ranges from the starting time of the current frame to the starting
  1062.   time plus the amount of time the shutter is open.  When
  1063. --- 16,22 ----
  1064.   that the
  1065.   frame ``sees'' during the time that the shutter is open.
  1066.   
  1067. ! Each ray cast by {\rayshade} samples a particular moment in time.
  1068.   The time value assigned to a ray
  1069.   ranges from the starting time of the current frame to the starting
  1070.   time plus the amount of time the shutter is open.  When
  1071. ***************
  1072. *** 27,33 ****
  1073.   computations are performed.
  1074.   
  1075.   The starting time of the current frame is computed using the
  1076. ! lenth of each frame
  1077.   the current frame number, and the starting time of the first frame.
  1078.   
  1079.   \begin{defkey}{shutter}{{\em t}}
  1080. --- 27,33 ----
  1081.   computations are performed.
  1082.   
  1083.   The starting time of the current frame is computed using the
  1084. ! length of each frame
  1085.   the current frame number, and the starting time of the first frame.
  1086.   
  1087.   \begin{defkey}{shutter}{{\em t}}
  1088. ***************
  1089. *** 73,79 ****
  1090.   The second animated variable, {\tt frame}, is equal to the current
  1091.   frame number.  Unlike the {\tt time} variable, {\tt frame} takes on
  1092.   a single value for the duration of each frame.  Thus, transforms
  1093. ! animated through the use of the {\tt time} variable will not exhibit
  1094.   motion blurring.
  1095.   
  1096.   Also supported is the {\tt linear} function.  This function uses
  1097. --- 73,79 ----
  1098.   The second animated variable, {\tt frame}, is equal to the current
  1099.   frame number.  Unlike the {\tt time} variable, {\tt frame} takes on
  1100.   a single value for the duration of each frame.  Thus, transforms
  1101. ! animated through the use of the {\tt frame} variable will not exhibit
  1102.   motion blurring.
  1103.   
  1104.   Also supported is the {\tt linear} function.  This function uses
  1105. ***************
  1106. *** 81,87 ****
  1107.   
  1108.   \begin{defkey}{linear}{{\tt (} {\em Stime, Sval, Etime, Eval} {\tt )}}
  1109.       Linearly interpolate between {\em Sval} at time
  1110. !     {\em Stime} and {\em Etime} at time {\em Eval}.
  1111.       If the current time is less than {\em Stime}, the function
  1112.       returns {\em Sval}.  If the current time is greater than
  1113.       {\em Etime}, {\em Eval} is returned.
  1114. --- 81,87 ----
  1115.   
  1116.   \begin{defkey}{linear}{{\tt (} {\em Stime, Sval, Etime, Eval} {\tt )}}
  1117.       Linearly interpolate between {\em Sval} at time
  1118. !     {\em Stime} and {\em Eval} at time {\em Etime}.
  1119.       If the current time is less than {\em Stime}, the function
  1120.       returns {\em Sval}.  If the current time is greater than
  1121.       {\em Etime}, {\em Eval} is returned.
  1122. ***************
  1123. *** 99,102 ****
  1124.   \end{verbatim}
  1125.   
  1126.   Further examples of animation may be found in the Examples directory
  1127. ! of the \rayshade distribution.
  1128. --- 99,102 ----
  1129.   \end{verbatim}
  1130.   
  1131.   Further examples of animation may be found in the Examples directory
  1132. ! of the {\rayshade} distribution.
  1133.  
  1134. Index: Doc/Guide/intro.tex
  1135. *** old/Doc/Guide/intro.tex    Mon Feb  3 12:42:31 1992
  1136. --- new/Doc/Guide/intro.tex    Fri Jan 17 10:29:12 1992
  1137. ***************
  1138. *** 1,7 ****
  1139.   \chapter{Introduction}
  1140.   \pagenumbering{arabic}
  1141.   
  1142. ! This document describes \rayshade in enough detail to enable
  1143.   the technical-minded to
  1144.   sit down and render some images.  In its current form,
  1145.   it is truly a draft, and even then
  1146. --- 1,7 ----
  1147.   \chapter{Introduction}
  1148.   \pagenumbering{arabic}
  1149.   
  1150. ! This document describes {\rayshade} in enough detail to enable
  1151.   the technical-minded to
  1152.   sit down and render some images.  In its current form,
  1153.   it is truly a draft, and even then
  1154. ***************
  1155. *** 10,34 ****
  1156.   This document does not provide any kind of thorough introduction
  1157.   to the basics of computer graphics or ray tracing.
  1158.   There are many other excellent sources for this kind of information.
  1159. ! The technical and coding details of \rayshade and
  1160.   its libraries will be documented elsewhere.
  1161.   
  1162.   \section{Getting Started}
  1163.   
  1164. ! The best way to learn how to use \rayshade is to dive right in and
  1165.   start making pictures.  Study the example
  1166. ! input files that are packaged with {\em rayshade}.  Run them through
  1167. ! rayshade to see what the images they produce look like.
  1168.   Change the input files; move the camera,
  1169.   change the field of view, modify surface properties, and see what differences
  1170.   your changes make, all the while referring to the appropriate portions
  1171.   of this document.  Browse through the individual chapters
  1172. ! to see what \rayshade can and cannot do.  The \rayshade quick reference
  1173.   guide may also help you sort out syntactical nasties.
  1174.   
  1175.   Throughout this text, the {\tt typewriter} type style is used to indicate
  1176.   keywords and other items that should be passed
  1177. ! directly {\em rayshade}.  Where appropriate,
  1178.   items in an {\em italic\/} style indicate
  1179.   places where you should provide an appropriate number or string.
  1180.   
  1181. --- 10,34 ----
  1182.   This document does not provide any kind of thorough introduction
  1183.   to the basics of computer graphics or ray tracing.
  1184.   There are many other excellent sources for this kind of information.
  1185. ! The technical and coding details of {\rayshade} and
  1186.   its libraries will be documented elsewhere.
  1187.   
  1188.   \section{Getting Started}
  1189.   
  1190. ! The best way to learn how to use {\rayshade} is to dive right in and
  1191.   start making pictures.  Study the example
  1192. ! input files that are packaged with {\rayshade}.  Run them through
  1193. ! {\rayshade} to see what the images they produce look like.
  1194.   Change the input files; move the camera,
  1195.   change the field of view, modify surface properties, and see what differences
  1196.   your changes make, all the while referring to the appropriate portions
  1197.   of this document.  Browse through the individual chapters
  1198. ! to see what {\rayshade} can and cannot do.  The {\rayshade} quick reference
  1199.   guide may also help you sort out syntactical nasties.
  1200.   
  1201.   Throughout this text, the {\tt typewriter} type style is used to indicate
  1202.   keywords and other items that should be passed
  1203. ! directly to {\rayshade}.  Where appropriate,
  1204.   items in an {\em italic\/} style indicate
  1205.   places where you should provide an appropriate number or string.
  1206.   
  1207. ***************
  1208. *** 43,53 ****
  1209.   
  1210.   \section{A Simple Example}
  1211.   
  1212. ! Because \rayshade provides a default camera description, surface properties,
  1213.   and a default light
  1214.   source, it is easy to construct short input files that allow you to
  1215.   experiment with objects, textures, and transformations.
  1216. ! If you haven't already run \rayshade on one of the example input files,
  1217.   you might want to try producing an image using the following input:
  1218.   
  1219.   \begin{verbatim}
  1220. --- 43,53 ----
  1221.   
  1222.   \section{A Simple Example}
  1223.   
  1224. ! Because {\rayshade} provides a default camera description, surface properties,
  1225.   and a default light
  1226.   source, it is easy to construct short input files that allow you to
  1227.   experiment with objects, textures, and transformations.
  1228. ! If you haven't already run {\rayshade} on one of the example input files,
  1229.   you might want to try producing an image using the following input:
  1230.   
  1231.   \begin{verbatim}
  1232. ***************
  1233. *** 54,60 ****
  1234.      sphere 2 0 0 0
  1235.   \end{verbatim}
  1236.   
  1237. ! If you are running \rayshade on a UNIX\footnote{UNIX is a trademark
  1238.   of AT\&T Bell Laboratories}-like machine, the command:
  1239.   \begin{verbatim}
  1240.     echo "sphere 2 0 0 0" | rayshade > sphere.rle
  1241. --- 54,60 ----
  1242.      sphere 2 0 0 0
  1243.   \end{verbatim}
  1244.   
  1245. ! If you are running {\rayshade} on a UNIX\footnote{UNIX is a trademark
  1246.   of AT\&T Bell Laboratories}-like machine, the command:
  1247.   \begin{verbatim}
  1248.     echo "sphere 2 0 0 0" | rayshade > sphere.rle
  1249.  
  1250. Index: libray/libsurf/surfshade.c
  1251. Prereq: 4.0
  1252. *** old/libray/libsurf/surfshade.c    Mon Feb  3 12:42:45 1992
  1253. --- new/libray/libsurf/surfshade.c    Fri Jan 17 10:29:47 1992
  1254. ***************
  1255. *** 13,21 ****
  1256.    * There is no warranty or other guarantee of fitness of this software
  1257.    * for any purpose.  It is provided solely "as is".
  1258.    *
  1259. !  * $Id: surfshade.c,v 4.0 91/07/17 14:41:15 kolb Exp Locker: kolb $
  1260.    *
  1261.    * $Log:    surfshade.c,v $
  1262.    * Revision 4.0  91/07/17  14:41:15  kolb
  1263.    * Initial version.
  1264.    * 
  1265. --- 13,28 ----
  1266.    * There is no warranty or other guarantee of fitness of this software
  1267.    * for any purpose.  It is provided solely "as is".
  1268.    *
  1269. !  * $Id: surfshade.c,v 4.0.1.2 92/01/10 14:08:28 cek Exp Locker: cek $
  1270.    *
  1271.    * $Log:    surfshade.c,v $
  1272. +  * Revision 4.0.1.2  92/01/10  14:08:28  cek
  1273. +  * patch3: Fixed additional composition problems.
  1274. +  * 
  1275. +  * Revision 4.0.1.1  91/12/13  11:54:51  cek
  1276. +  * patch3: Fixed ordering of world/model xform composition.
  1277. +  * patch3: Geometric normal now transformed correctly.
  1278. +  * 
  1279.    * Revision 4.0  91/07/17  14:41:15  kolb
  1280.    * Initial version.
  1281.    * 
  1282. ***************
  1283. *** 67,72 ****
  1284. --- 74,80 ----
  1285.        */
  1286.       for (i = 0, hp = hitlist->data; i < hitlist->nodes -1; hp++, i++) {
  1287.           obj = hp->obj;
  1288. +         texturing = texturing || obj->texture;
  1289.           if (hp->dotrans) {
  1290.               /*
  1291.                * Here we're actually computing prim2world.
  1292. ***************
  1293. *** 73,87 ****
  1294.                * When finished, we invert it.
  1295.                */
  1296.               if (transforming) {
  1297. !                 TransCompose(&hp->trans, &world2model,
  1298.                       &world2model);
  1299.               } else {
  1300.                   TransCopy(&hp->trans, &world2model);
  1301.               }
  1302. -             transforming = TRUE;
  1303.           }
  1304. -         if (obj->texture)
  1305. -             texturing = TRUE;
  1306.       }
  1307.   
  1308.       /*
  1309. --- 81,93 ----
  1310.                * When finished, we invert it.
  1311.                */
  1312.               if (transforming) {
  1313. !                 TransCompose(&world2model, &hp->trans,
  1314.                       &world2model);
  1315.               } else {
  1316.                   TransCopy(&hp->trans, &world2model);
  1317. +                 transforming = TRUE;
  1318.               }
  1319.           }
  1320.       }
  1321.   
  1322.       /*
  1323. ***************
  1324. *** 150,156 ****
  1325.       TransInit(&prim2model);
  1326.       rtmp = hitlist->data[0].ray;
  1327.       /*
  1328. !      * Walk down hitlist.
  1329.        */
  1330.       for (hp = hitlist->data, i = 0; i < hitlist->nodes -1; i++, hp++) {
  1331.           obj = hp->obj;
  1332. --- 156,166 ----
  1333.       TransInit(&prim2model);
  1334.       rtmp = hitlist->data[0].ray;
  1335.       /*
  1336. !      * Walk down hitlist (from primitive up to World object),
  1337. !      * transforming hit point and shading normal and applying textures.
  1338. !      * Note that the texturing routines want gnorm in object space,
  1339. !      * so we don't transform the geometric normal until texturing
  1340. !      * is complete.
  1341.        */
  1342.       for (hp = hitlist->data, i = 0; i < hitlist->nodes -1; i++, hp++) {
  1343.           obj = hp->obj;
  1344. ***************
  1345. *** 161,169 ****
  1346.                    * Compose prim<-->model and world<-->model
  1347.                    * with current transformation.
  1348.                    */
  1349. !                 TransCompose(&hp->trans, &prim2model,
  1350.                       &prim2model);
  1351. !                 TransCompose(&hp->trans, &world2model,
  1352.                       &world2model);
  1353.                   /*
  1354.                    * Transform point and ray to model space.
  1355. --- 171,179 ----
  1356.                    * Compose prim<-->model and world<-->model
  1357.                    * with current transformation.
  1358.                    */
  1359. !                 TransCompose(&prim2model, &hp->trans,
  1360.                       &prim2model);
  1361. !                 TransCompose(&world2model, &hp->trans,
  1362.                       &world2model);
  1363.                   /*
  1364.                    * Transform point and ray to model space.
  1365. ***************
  1366. *** 179,183 ****
  1367. --- 189,195 ----
  1368.               TextApply(obj->texture, prim, &rtmp, pos, norm,
  1369.                   gnorm, surf, &prim2model, &world2model);
  1370.       }
  1371. +     /* Transform geometric normal from object to world space. */
  1372. +     NormalTransform(gnorm, &world2model.trans);
  1373.       return entering;
  1374.   }
  1375.  
  1376. Index: Doc/Guide/texture.tex
  1377. *** old/Doc/Guide/texture.tex    Mon Feb  3 12:50:02 1992
  1378. --- new/Doc/Guide/texture.tex    Fri Jan 17 10:29:15 1992
  1379. ***************
  1380. *** 45,50 ****
  1381. --- 45,52 ----
  1382.   The returned normalized vector is weighted by {\em scale}
  1383.   and the result is added to the normal vector at the point of intersection.
  1384.   \end{defkey}
  1385. + Using an image texture applied to the ``bump'' component offers a more
  1386. + direct way to control the modification of surface normals (see below).
  1387.   
  1388.   \begin{defkey}{checker}{$<${\em Surface}$>$}
  1389.   Applies a 3D checkerboard texture.  Every point that falls within an
  1390. ***************
  1391. *** 144,150 ****
  1392.       of {\em bump} controls the extent to which the bump appears
  1393.       to be displaced from the rest of the surface.  If negative,
  1394.       the stripe will appear to
  1395. !     sink into the surface; if negative, it will appear to stand
  1396.       out of the surface.
  1397.   \end{defkey}
  1398.   Mapping functions are described below.
  1399. --- 146,152 ----
  1400.       of {\em bump} controls the extent to which the bump appears
  1401.       to be displaced from the rest of the surface.  If negative,
  1402.       the stripe will appear to
  1403. !     sink into the surface; if positive, it will appear to stand
  1404.       out of the surface.
  1405.   \end{defkey}
  1406.   Mapping functions are described below.
  1407. ***************
  1408. *** 157,163 ****
  1409.   
  1410.   \section {Image Texturing}
  1411.   
  1412. ! {\em Rayshade} also supports an {\tt image} texture.  This texture
  1413.   allows you to use images to modify the characteristics of a surface.  You
  1414.   can use three-channel images to modify the any or all of
  1415.   the ambient, diffuse, and specular colors of a surface.
  1416. --- 159,165 ----
  1417.   
  1418.   \section {Image Texturing}
  1419.   
  1420. ! {\Rayshade} also supports an {\tt image} texture.  This texture
  1421.   allows you to use images to modify the characteristics of a surface.  You
  1422.   can use three-channel images to modify the any or all of
  1423.   the ambient, diffuse, and specular colors of a surface.
  1424. ***************
  1425. *** 222,228 ****
  1426.       should be repeated along the $v$ axis.  If either value is zero,
  1427.       the image is repeated infinitely along the appropriate axis.
  1428.   \end{defkey}
  1429. ! Tiling is usually only a concern when linear mapping is being used,
  1430.   though it may also be used if image textures are being scaled.  By default
  1431.   {\em un} and {\em vn} are both zero.
  1432.    
  1433. --- 224,230 ----
  1434.       should be repeated along the $v$ axis.  If either value is zero,
  1435.       the image is repeated infinitely along the appropriate axis.
  1436.   \end{defkey}
  1437. ! Tiling is usually only a concern when planar mapping is being used,
  1438.   though it may also be used if image textures are being scaled.  By default
  1439.   {\em un} and {\em vn} are both zero.
  1440.    
  1441.  
  1442.  
  1443. *** End of Patch 4 ***
  1444.  
  1445. exit 0 # Just in case...
  1446.