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

Comparing ray/src/rt/rtrace.c (file contents):
Revision 1.11 by greg, Sat Aug 18 10:34:47 1990 UTC vs.
Revision 1.12 by greg, Thu Mar 28 10:16:35 1991 UTC

# Line 20 | Line 20 | static char SCCSid[] = "$SunId$ LBL";
20   *  All values default to ascii representation of real
21   *  numbers.  Binary representations can be selected
22   *  with '-ff' for float or '-fd' for double.  By default,
23 < *  radiance is computed.  The '-i' option indicates that
23 > *  radiance is computed.  The '-oi' or '-oI' options indicate that
24   *  irradiance values are desired.
25   */
26  
# Line 65 | Line 65 | static int  puta(), putf(), putd();
65  
66   static int  (*putreal)();
67  
68 + static double  Lambfa[5] = {PI, PI, PI, 0.0, 0.0};
69 + static OBJREC  Lamb = {
70 +        OVOID, MAT_PLASTIC, "Lambertian",
71 +        {0, 5, NULL, Lambfa}, NULL, -1,
72 + };                                      /* a Lambertian surface */
73  
74 +
75   quit(code)                      /* quit program */
76   int  code;
77   {
# Line 105 | Line 111 | char  *fname;
111                                                          /* compute and print */
112                  if (outvals[0] == 'i')
113                          irrad(orig, direc);
114 +                else if (outvals[0] == 'I')
115 +                        Irrad(orig, direc);
116                  else
117                          radiance(orig, direc);
118                                                          /* flush if time */
# Line 197 | Line 205 | FVECT  org, dir;
205   irrad(org, dir)                 /* compute irradiance value */
206   FVECT  org, dir;
207   {
200        static double  Lambfa[5] = {PI, PI, PI, 0.0, 0.0};
201        static OBJREC  Lamb = {
202                OVOID, MAT_PLASTIC, "Lambertian",
203                {0, 5, NULL, Lambfa}, NULL, -1,
204        };
208          register int  i;
209  
210          for (i = 0; i < 3; i++) {
# Line 217 | Line 220 | FVECT  org, dir;
220                  thisray.rop[i] = org[i] + 1e-4*dir[i];
221                                          /* compute and print */
222          (*ofun[Lamb.otype].funp)(&Lamb, &thisray);
223 +        oputv(&thisray);
224 +        if (outform == 'a')
225 +                putchar('\n');
226 + }
227 +
228 +
229 + Irrad(org, dir)         /* compute irradiance value after intersection */
230 + FVECT  org, dir;
231 + {
232 +                                        /* compute intersection */
233 +        VCOPY(thisray.rorg, org);
234 +        VCOPY(thisray.rdir, dir);
235 +        rayorigin(&thisray, NULL, PRIMARY, 1.0);
236 +        localhit(&thisray, &thescene);
237 +        if (thisray.ro != NULL)         /* pretend we hit Lambertian surf. */
238 +                (*ofun[Lamb.otype].funp)(&Lamb, &thisray);
239          oputv(&thisray);
240          if (outform == 'a')
241                  putchar('\n');

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines