Commit: b99d1e34b975d3f56d389ab4fc479d1b82a7b89b Parent: 319b7929f5b3893a6de3f79628149335728dd838 Author: Randy Palamar Date: Tue, 2 Apr 2024 20:21:21 -0600 swap row and column idx so that output is oriented correctly Diffstat:
M | mcml.c | | | 6 | +++--- |
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mcml.c b/mcml.c @@ -261,9 +261,9 @@ reflect_or_transmit_photon(Photon *p) * we are in bounds of output region */ if (p->pos.x > -gctx.xoff && p->pos.x < gctx.xoff && p->pos.y > -gctx.yoff && p->pos.y < gctx.yoff) { - u32 ri = (p->pos.x + gctx.xoff) / gctx.dx; - u32 ci = (p->pos.y + gctx.yoff) / gctx.dy; - Rd_xy.b[ri * Rd_xy.Ny + ci] += p->w; + u32 ri = (p->pos.y + gctx.yoff) / gctx.dy; + u32 ci = (p->pos.x + gctx.xoff) / gctx.dx; + Rd_xy.b[ri * Rd_xy.Nx + ci] += p->w; } } p->dead = 1;