diff options
author | Tavian Barnes <tavianator@gmail.com> | 2009-07-16 21:31:51 +0000 |
---|---|---|
committer | Tavian Barnes <tavianator@gmail.com> | 2009-07-16 21:31:51 +0000 |
commit | bbe317fb2bde1b2b88df66e5426c9ee78e40a0b6 (patch) | |
tree | 0406204d223c4a4ddd3a6aaa51c69db88114e3d5 /libdimension/raytrace.c | |
parent | 7e7ec10dea751540eda7898cf83f8471185aa063 (diff) | |
download | dimension-bbe317fb2bde1b2b88df66e5426c9ee78e40a0b6.tar.xz |
Have camera callbacks take canvas coordinates as doubles.
Diffstat (limited to 'libdimension/raytrace.c')
-rw-r--r-- | libdimension/raytrace.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libdimension/raytrace.c b/libdimension/raytrace.c index 470af4f..df61d6b 100644 --- a/libdimension/raytrace.c +++ b/libdimension/raytrace.c @@ -213,7 +213,9 @@ dmnsn_raytrace_scene_impl(dmnsn_progress *progress, dmnsn_scene *scene, if (scene->quality >= DMNSN_RENDER_OBJECTS) { /* Get the ray corresponding to the (x,y)'th pixel */ - ray = (*scene->camera->ray_fn)(scene->camera, scene->canvas, x, y); + ray = (*scene->camera->ray_fn)(scene->camera, + ((double)x)/(scene->canvas->x - 1), + ((double)y)/(scene->canvas->y - 1)); /* Shoot a ray */ color = dmnsn_raytrace_shoot(scene, color, ray); } |