From: Andy Spencer Date: Mon, 24 Jan 2011 04:35:40 +0000 (+0000) Subject: Fix off-by-one-half calculating ray distances X-Git-Tag: v0.5~31 X-Git-Url: http://pileus.org/git/?p=aweather;a=commitdiff_plain;h=c76dc2ccdf833782380ee926da957c6a3e4c8c29 Fix off-by-one-half calculating ray distances --- diff --git a/src/plugins/level2.c b/src/plugins/level2.c index dec504a..906561a 100644 --- a/src/plugins/level2.c +++ b/src/plugins/level2.c @@ -166,8 +166,8 @@ void aweather_level2_draw(GritsObject *_self, GritsOpenGL *opengl) double lx = sin(angle); double ly = cos(angle); - double near_dist = ray->h.range_bin1; - double far_dist = ray->h.nbins*ray->h.gate_size + ray->h.range_bin1; + double near_dist = ray->h.range_bin1 - ((double)ray->h.gate_size/2.); + double far_dist = near_dist + (double)ray->h.nbins*ray->h.gate_size; /* (find middle of bin) / scale for opengl */ // near left