--- ray/src/gen/mkillum2.c 1991/07/25 12:52:18 1.6 +++ ray/src/gen/mkillum2.c 1991/07/30 13:00:26 1.9 @@ -111,7 +111,7 @@ char *nm; for (j = 0; j < 3; j++) org[j] += .001*fa->norm[j]; /* send sample */ - raysamp(distarr+dim[1]*nazi+dim[2], org, dir, rt); + raysamp(distarr+3*(dim[1]*nazi+dim[2]), org, dir, rt); } rayflush(rt); /* write out the face w/ distribution */ @@ -151,11 +151,7 @@ char *nm; dim[0] = random(); /* sample sphere */ for (dim[1] = 0; dim[1] < nalt; dim[1]++) - for (dim[2] = 0; dim[2] < nazi; dim[2]++) { - if (il->nsamps > 2 && nazi > 20) { - rounddir(dir, (dim[1]+.5)/nalt, (dim[2]+.5)/nazi); - mkaxes(u, v, dir); - } + for (dim[2] = 0; dim[2] < nazi; dim[2]++) for (i = 0; i < il->nsamps; i++) { /* random direction */ dim[3] = 1; @@ -164,8 +160,7 @@ char *nm; r2 = (dim[2]+urand(urind(ilhash(dim,4),i)))/nazi; rounddir(dir, r1, r2); /* random location */ - if (il->nsamps <= 2 || nazi <= 20) - mkaxes(u, v, dir); /* yuck! */ + mkaxes(u, v, dir); /* yuck! */ dim[3] = 3; r3 = sqrt(urand(urind(ilhash(dim,4),i))); dim[3] = 4; @@ -179,9 +174,8 @@ char *nm; dir[j] = -dir[j]; } /* send sample */ - raysamp(distarr+dim[1]*nazi+dim[2], org, dir, rt); + raysamp(distarr+3*(dim[1]*nazi+dim[2]), org, dir, rt); } - } rayflush(rt); /* write out the sphere w/ distribution */ roundout(il, distarr, nalt, nazi); @@ -243,7 +237,7 @@ char *nm; .001*co->ad[j]; /* send sample */ - raysamp(distarr+dim[1]*nazi+dim[2], org, dir, rt); + raysamp(distarr+3*(dim[1]*nazi+dim[2]), org, dir, rt); } rayflush(rt); /* write out the ring w/ distribution */ @@ -278,8 +272,7 @@ register struct rtproc *rt; if (rt->nrays <= 0) return; - i = 6*rt->nrays + 3; - rt->buf[i++] = 0.; rt->buf[i++] = 0.; rt->buf[i] = 0.; + bzero(rt->buf+6*rt->nrays, 6*sizeof(float)); if ( process(rt->pd, (char *)rt->buf, (char *)rt->buf, 3*sizeof(float)*rt->nrays, 6*sizeof(float)*(rt->nrays+1)) <