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

Comparing ray/src/rt/lookamb.c (file contents):
Revision 1.3 by greg, Thu Jun 6 10:09:50 1991 UTC vs.
Revision 1.4 by greg, Fri Jun 7 10:04:27 1991 UTC

# Line 14 | Line 14 | static char SCCSid[] = "$SunId$ LBL";
14  
15   #include  "color.h"
16  
17 + #include  "ambient.h"
18  
18 typedef struct ambval {
19        float  pos[3];          /* position in space */
20        float  dir[3];          /* normal direction */
21        int  lvl;               /* recursion level of parent ray */
22        float  weight;          /* weight of parent ray */
23        COLOR  val;             /* computed ambient value */
24        float  rad;             /* validity radius */
25        struct ambval  *next;   /* next in list */
26 }  AMBVAL;                      /* ambient value */
19  
20   int  dataonly = 0;
21  
# Line 81 | Line 73 | FILE  *fp;
73                          printf("%e\t%e\t%e\n", colval(av.val,RED),
74                                                  colval(av.val,GRN),
75                                                  colval(av.val,BLU));
76 +                        printf("%f\t%f\t%f\t", av.gpos[0],
77 +                                        av.gpos[1], av.gpos[2]);
78 +                        printf("%f\t%f\t%f\t", av.gdir[0],
79 +                                        av.gdir[1], av.gdir[2]);
80                  } else {
81                          printf("\nPosition:\t%f\t%f\t%f\n", av.pos[0],
82                                          av.pos[1], av.pos[2]);
# Line 90 | Line 86 | FILE  *fp;
86                                          av.weight, av.rad);
87                          printf("Value:\t\t%e\t%e\t%e\n", colval(av.val,RED),
88                                          colval(av.val,GRN), colval(av.val,BLU));
89 +                        printf("Pos.Grad:\t%f\t%f\t%f\n", av.gpos[0],
90 +                                        av.gpos[1], av.gpos[2]);
91 +                        printf("Dir.Grad:\t%f\t%f\t%f\n", av.gdir[0],
92 +                                        av.gdir[1], av.gdir[2]);
93                  }
94                  if (ferror(stdout))
95                          exit(1);
# Line 121 | Line 121 | FILE  *fp;
121                  if (fscanf(fp, "%f %f %f",
122                                  &av.val[RED], &av.val[GRN], &av.val[BLU]) != 3)
123                          return;
124 +                if (!dataonly)
125 +                        fscanf(fp, "%*s");
126 +                if (fscanf(fp, "%f %f %f",
127 +                                &av.gpos[0], &av.gpos[1], &av.gpos[2]) != 3)
128 +                        return;
129 +                if (!dataonly)
130 +                        fscanf(fp, "%*s");
131 +                if (fscanf(fp, "%f %f %f",
132 +                                &av.gdir[0], &av.gdir[1], &av.gdir[2]) != 3)
133 +                        return;
134 +                av.next = NULL;
135                  fwrite((char *)&av, sizeof(AMBVAL), 1, stdout);
136                  if (ferror(stdout))
137                          exit(1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines