--- ray/src/rt/rv2.c 2018/03/30 23:14:07 2.66 +++ ray/src/rt/rv2.c 2021/02/01 16:19:49 2.71 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rv2.c,v 2.66 2018/03/30 23:14:07 greg Exp $"; +static const char RCSid[] = "$Id: rv2.c,v 2.71 2021/02/01 16:19:49 greg Exp $"; #endif /* * rv2.c - command routines used in tracing a view. @@ -16,9 +16,9 @@ static const char RCSid[] = "$Id: rv2.c,v 2.66 2018/03 #include "rtprocess.h" /* win_popen() */ #include "paths.h" #include "ray.h" -#include "source.h" #include "ambient.h" #include "otypes.h" +#include "otspecial.h" #include "rpaint.h" extern int psample; /* pixel sample size */ @@ -399,7 +399,7 @@ getorigin( /* origin viewpoint */ } if (thisray.rod < 0.0) /* don't look through other side */ flipsurface(&thisray); - VSUM(nv.vp, thisray.rop, thisray.ron, 2.0*FTINY); + VSUM(nv.vp, thisray.rop, thisray.ron, 20.0*FTINY); VCOPY(nv.vdir, thisray.ron); } else if (!sscanvec(sskip2(s,3), nv.vdir) || normalize(nv.vdir) == 0.0) VCOPY(nv.vdir, ourview.vdir); @@ -793,7 +793,7 @@ traceray( /* trace a single ray */ matspec[0] = '\0'; if (thisray.ro->omod != OVOID) { mod = objptr(thisray.ro->omod); - mat = findmaterial(mod); + mat = findmaterial(thisray.ro); } if (thisray.rod < 0.0) strcpy(matspec, "back of "); @@ -812,12 +812,12 @@ traceray( /* trace a single ray */ ofun[ino->otype].funame, ino->oname); (*dev->comout)(buf); (*dev->comin)(buf, NULL); - if (thisray.rot >= FHUGE) + if (thisray.rot >= FHUGE*.99) (*dev->comout)("at infinity"); else { sprintf(buf, "at (%.6g %.6g %.6g) (%.6g)", thisray.rop[0], thisray.rop[1], - thisray.rop[2], thisray.rt); + thisray.rop[2], raydistance(&thisray)); (*dev->comout)(buf); } (*dev->comin)(buf, NULL);