--- ray/src/hd/holo.c 1997/11/12 16:29:43 3.7 +++ ray/src/hd/holo.c 1997/12/15 20:43:24 3.9 @@ -199,16 +199,13 @@ register GCOORD *gc; } -hdlseg(lseg, hp, i) /* compute line segment for beam */ +hdlseg(lseg, hp, gc) /* compute line segment for beam */ register int lseg[2][3]; register HOLO *hp; -int i; +GCOORD gc[2]; { - GCOORD gc[2]; register int k; - if (!hdbcoord(gc, hp, i)) /* compute grid coordinates */ - return(0); for (k = 0; k < 2; k++) { /* compute end points */ lseg[k][gc[k].w>>1] = gc[k].w&1 ? hp->grid[gc[k].w>>1]-1 : 0 ; lseg[k][wg0[gc[k].w]] = gc[k].i[0]; @@ -256,11 +253,18 @@ FVECT wp; hdworld(wp, hp, gp) /* compute world coordinates */ register FVECT wp; register HOLO *hp; -register FVECT gp; +FVECT gp; { - VSUM(wp, hp->orig, hp->xv[0], gp[0]); - VSUM(wp, wp, hp->xv[1], gp[1]); - VSUM(wp, wp, hp->xv[2], gp[2]); + register double d; + + d = gp[0]/hp->grid[0]; + VSUM(wp, hp->orig, hp->xv[0], d); + + d = gp[1]/hp->grid[1]; + VSUM(wp, wp, hp->xv[1], d); + + d = gp[2]/hp->grid[2]; + VSUM(wp, wp, hp->xv[2], d); }