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

Comparing ray/src/gen/mkillum2.c (file contents):
Revision 1.12 by greg, Fri Aug 23 12:30:33 1991 UTC vs.
Revision 2.2 by greg, Wed Mar 11 12:25:47 1992 UTC

# Line 26 | Line 26 | char  *nm;
26          sprintf(errmsg, "(%s): cannot make illum for %s \"%s\"",
27                          nm, ofun[ob->otype].funame, ob->oname);
28          error(WARNING, errmsg);
29 <        if (!(il->flags & IL_LIGHT))
30 <                printobj(il->altmat, ob);
29 >        printobj(il->altmat, ob);
30   }
31  
32  
# Line 88 | Line 87 | char  *nm;
87                      h = ilhash(dim, 3) + i;
88                      multisamp(sp, 2, urand(h));
89                      r1 = (dim[1] + sp[0])/nalt;
90 <                    r2 = (dim[2] + sp[1])/nazi;
90 >                    r2 = (dim[2] + sp[1] - .5)/nazi;
91                      flatdir(dn, r1, r2);
92                      for (j = 0; j < 3; j++)
93                          dir[j] = -dn[0]*u[j] - dn[1]*v[j] - dn[2]*fa->norm[j];
# Line 120 | Line 119 | char  *nm;
119                  if (il->sampdens > 0)
120                          flatout(il, distarr, nalt, nazi, u, v, fa->norm);
121                  illumout(il, ob);
122 <        } else if (!(il->flags & IL_LIGHT))
122 >        } else
123                  printobj(il->altmat, ob);
124                                  /* clean up */
125          freeface(ob);
# Line 166 | Line 165 | char  *nm;
165                      multisamp(sp, 4, urand(ilhash(dim,3)+i));
166                                          /* random direction */
167                      r1 = (dim[1] + sp[0])/nalt;
168 <                    r2 = (dim[2] + sp[1])/nazi;
168 >                    r2 = (dim[2] + sp[1] - .5)/nazi;
169                      rounddir(dir, r1, r2);
170                                          /* random location */
171                      mkaxes(u, v, dir);          /* yuck! */
# Line 191 | Line 190 | char  *nm;
190                  else
191                          objerror(ob, WARNING, "diffuse distribution");
192                  illumout(il, ob);
193 <        } else if (!(il->flags & IL_LIGHT))
193 >        } else
194                  printobj(il->altmat, ob);
195                                  /* clean up */
196          free((char *)distarr);
# Line 236 | Line 235 | char  *nm;
235                      multisamp(sp, 4, urand(ilhash(dim,3)+i));
236                                          /* random direction */
237                      r1 = (dim[1] + sp[0])/nalt;
238 <                    r2 = (dim[2] + sp[1])/nalt;
238 >                    r2 = (dim[2] + sp[1] - .5)/nazi;
239                      flatdir(dn, r1, r2);
240                      for (j = 0; j < 3; j++)
241                          dir[j] = -dn[0]*u[j] - dn[1]*v[j] - dn[2]*co->ad[j];
# Line 259 | Line 258 | char  *nm;
258                  if (il->sampdens > 0)
259                          flatout(il, distarr, nalt, nazi, u, v, co->ad);
260                  illumout(il, ob);
261 <        } else if (!(il->flags & IL_LIGHT))
261 >        } else
262                  printobj(il->altmat, ob);
263                                  /* clean up */
264          freecone(ob);
# Line 291 | Line 290 | register struct rtproc  *rt;
290          if (rt->nrays <= 0)
291                  return;
292          bzero(rt->buf+6*rt->nrays, 6*sizeof(float));
293 +        errno = 0;
294          if ( process(rt->pd, (char *)rt->buf, (char *)rt->buf,
295                          3*sizeof(float)*rt->nrays,
296                          6*sizeof(float)*(rt->nrays+1)) <

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines