ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rv3.c
(Generate patch)

Comparing ray/src/rt/rv3.c (file contents):
Revision 2.2 by greg, Fri Jan 17 09:27:21 1992 UTC vs.
Revision 2.6 by greg, Tue Dec 20 20:18:41 1994 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1987 Regents of the University of California */
1 > /* Copyright (c) 1994 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 19 | Line 19 | static char SCCSid[] = "$SunId$ LBL";
19   #include  "random.h"
20  
21   #ifndef WFLUSH
22 < #define WFLUSH          30              /* flush after this many rays */
22 > #ifdef SPEED
23 > #define WFLUSH          (5*SPEED)
24 > #else
25 > #define WFLUSH          100             /* flush after this many rays */
26   #endif
27 + #endif
28  
29   #ifdef  SMLFLT
30   #define  sscanvec(s,v)  (sscanf(s,"%f %f %f",v,v+1,v+2)==3)
# Line 99 | Line 103 | double  *mp;
103                  (*dev->comout)("Pick view center\n");
104                  if ((*dev->getcur)(&x, &y) == ABORT)
105                          return(-1);
106 <                if (viewray(thisray.rorg, thisray.rdir, &ourview,
107 <                                (x+.5)/hresolu, (y+.5)/vresolu) < 0) {
106 >                if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir,
107 >                        &ourview, (x+.5)/hresolu, (y+.5)/vresolu)) < -FTINY) {
108                          error(COMMAND, "not on image");
109                          return(-1);
110                  }
# Line 143 | Line 147 | paint(p, xmin, ymin, xmax, ymax)       /* compute and paint
147   register PNODE  *p;
148   int  xmin, ymin, xmax, ymax;
149   {
150 <        extern long  nrays;
151 <        static long  lastflush = 0;
150 >        extern unsigned long  nrays;
151 >        static unsigned long  lastflush = 0;
152          static RAY  thisray;
153          double  h, v;
154  
# Line 158 | Line 162 | int  xmin, ymin, xmax, ymax;
162          h = xmin + (xmax-xmin)*frandom();
163          v = ymin + (ymax-ymin)*frandom();
164          
165 <        if (viewray(thisray.rorg, thisray.rdir, &ourview,
166 <                        h/hresolu, v/vresolu) < 0) {
165 >        if ((thisray.rmax = viewray(thisray.rorg, thisray.rdir, &ourview,
166 >                        h/hresolu, v/vresolu)) < -FTINY) {
167                  setcolor(thisray.rcol, 0.0, 0.0, 0.0);
168          } else {
169                  rayorigin(&thisray, NULL, PRIMARY, 1.0);
# Line 381 | Line 385 | moveview(angle, elev, mag, vc)                 /* move viewpoint */
385   double  angle, elev, mag;
386   FVECT  vc;
387   {
384        extern double  sqrt(), dist2();
388          double  d;
389          FVECT  v1;
390          VIEW  nv;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines