camera: correct x/y calculations in Camera::render.
This commit is contained in:
parent
059f710706
commit
e752536430
@ -147,8 +147,8 @@ impl Camera {
|
||||
/// ```
|
||||
pub fn render(&self, w: &World) -> Canvas {
|
||||
let mut image = Canvas::new(self.hsize, self.vsize, BLACK);
|
||||
for y in 0..self.hsize {
|
||||
for x in 0..self.vsize {
|
||||
for y in 0..self.vsize {
|
||||
for x in 0..self.hsize {
|
||||
let ray = self.ray_for_pixel(x, y);
|
||||
let color = w.color_at(&ray);
|
||||
image.set(x, y, color);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user