--- ray/src/rt/rtrace.c 2021/01/27 00:00:05 2.100 +++ ray/src/rt/rtrace.c 2021/02/16 22:06:00 2.101 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rtrace.c,v 2.100 2021/01/27 00:00:05 greg Exp $"; +static const char RCSid[] = "$Id: rtrace.c,v 2.101 2021/02/16 22:06:00 greg Exp $"; #endif /* * rtrace.c - program and variables for individual ray tracing. @@ -420,21 +420,22 @@ rtcompute( /* compute and print ray value(s) */ ) { /* set up ray */ - rayorigin(&thisray, PRIMARY, NULL, NULL); if (imm_irrad) { VSUM(thisray.rorg, org, dir, 1.1e-4); thisray.rdir[0] = -dir[0]; thisray.rdir[1] = -dir[1]; thisray.rdir[2] = -dir[2]; thisray.rmax = 0.0; - thisray.revf = rayirrad; } else { VCOPY(thisray.rorg, org); VCOPY(thisray.rdir, dir); thisray.rmax = dmax; - if (castonly) - thisray.revf = raycast; } + rayorigin(&thisray, PRIMARY, NULL, NULL); + if (imm_irrad) + thisray.revf = rayirrad; + else if (castonly) + thisray.revf = raycast; if (ray_pnprocs > 1) { /* multiprocessing FIFO? */ if (ray_fifo_in(&thisray) < 0) error(USER, "lost children");