Skip to content

Commit

Permalink
Add some walls, floor and ceiling to the example scene
Browse files Browse the repository at this point in the history
Yes, the colors (still) don't look particularly good, all spheres are
assumed to emit light and perfectly fully reflect lighting bouncing off
of them, this'll be changed.
  • Loading branch information
jstasiak committed Jul 10, 2019
1 parent c069f83 commit 23696aa
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
Binary file modified output.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,61 @@ fn main() {
radius: 1.0,
color: Color::new_blue(),
},
// Let's simulate walls, floor and ceiling with spheres
Sphere {
center: Vector {
x: 0.0,
y: -10005.0,
z: 0.0,
},
radius: 10000.0,
color: Color::new_white(),
},
Sphere {
center: Vector {
x: 0.0,
y: 10005.0,
z: 0.0,
},
radius: 10000.0,
color: Color::new_white(),
},
Sphere {
center: Vector {
x: -10010.0,
y: 0.0,
z: 0.0,
},
radius: 10000.0,
color: Color::new_white(),
},
Sphere {
center: Vector {
x: 10010.0,
y: 0.0,
z: 0.0,
},
radius: 10000.0,
color: Color::new_white(),
},
Sphere {
center: Vector {
x: 0.0,
y: 0.0,
z: -10015.0,
},
radius: 10000.0,
color: Color::new_white(),
},
Sphere {
center: Vector {
x: 0.0,
y: 0.0,
z: 10005.0,
},
radius: 10000.0,
color: Color::new_white(),
},
];
let camera = Camera {
position: Vector::zero(),
Expand Down

0 comments on commit 23696aa

Please sign in to comment.