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

Comparing ray/src/gen/mkillum3.c (file contents):
Revision 1.1 by greg, Wed Jul 24 16:48:45 1991 UTC vs.
Revision 1.5 by greg, Fri Aug 23 12:30:35 1991 UTC

# Line 87 | Line 87 | int  c;
87   }
88  
89  
90 illumout(il, ob)                /* print illum object */
91 register struct illum_args  *il;
92 OBJREC  *ob;
93 {
94        double  cout[3];
95
96        printf("\n%s%s %s %s", il->matname, DSTSUF,
97                        ofun[il->flags&IL_LIGHT?MAT_LIGHT:MAT_ILLUM].funame,
98                        il->matname);
99        if (il->flags & IL_LIGHT || !strcmp(il->altmat,VOIDID))
100                printf("\n0");
101        else
102                printf("\n1 %s", il->altmat);
103        if (il->flags & IL_COLAVG) {
104                cout[0] = il->col[0];
105                cout[1] = il->col[1];
106                cout[2] = il->col[2];
107        } else {
108                cout[0] = cout[1] = cout[2] = brt(il->col);
109        }
110        if (il->flags & IL_LIGHT)
111                printf("\n3 %f %f %f\n", cout[0], cout[1], cout[2]);
112        else
113                printf("\n4 %f %f %f 0\n", cout[0], cout[1], cout[2]);
114
115        printobj(il->matname, ob);
116 }
117
118
90   flatout(il, da, n, m, u, v, w)          /* write hemispherical distribution */
91   struct illum_args  *il;
92   float  *da;
# Line 125 | Line 96 | FVECT  u, v, w;
96          FILE  *dfp;
97          int  i;
98  
128        average(il, da, n*m);
99          if (il->flags & IL_COLDST) {
100                  printf("\n%s %s %s%s", VOIDID, ofun[PAT_CDATA].funame,
101                                  il->matname, DSTSUF);
# Line 164 | Line 134 | int  n, m;
134          FILE  *dfp;
135          int  i;
136  
167        average(il, da, n*m);
137          if (il->flags & IL_COLDST) {
138                  printf("\n%s %s %s%s", VOIDID, ofun[PAT_CDATA].funame,
139                                  il->matname, DSTSUF);
# Line 192 | Line 161 | int  n, m;
161   }
162  
163  
164 + illumout(il, ob)                /* print illum object */
165 + register struct illum_args  *il;
166 + OBJREC  *ob;
167 + {
168 +        double  cout[3];
169 +
170 +        if (il->sampdens <= 0)
171 +                printf("\n%s ", VOIDID);
172 +        else
173 +                printf("\n%s%s ", il->matname, DSTSUF);
174 +        printf("%s %s", ofun[il->flags&IL_LIGHT?MAT_LIGHT:MAT_ILLUM].funame,
175 +                        il->matname);
176 +        if (il->flags & IL_LIGHT || !strcmp(il->altmat,VOIDID))
177 +                printf("\n0");
178 +        else
179 +                printf("\n1 %s", il->altmat);
180 +        if (il->flags & IL_COLAVG) {
181 +                cout[0] = il->col[0];
182 +                cout[1] = il->col[1];
183 +                cout[2] = il->col[2];
184 +        } else {
185 +                cout[0] = cout[1] = cout[2] = brt(il->col);
186 +        }
187 +        printf("\n0\n3 %f %f %f\n", cout[0], cout[1], cout[2]);
188 +
189 +        printobj(il->matname, ob);
190 + }
191 +
192 +
193   average(il, da, n)              /* compute average value for distribution */
194   register struct illum_args  *il;
195   register float  *da;
# Line 208 | Line 206 | int  n;
206          }
207          for (i = 0; i < 3; i++)
208                  il->col[i] /= (double)n*il->nsamps;
209 +
210 +        return(brt(il->col) >= il->minbrt);
211   }
212  
213  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines