used pixels instead of state

This commit is contained in:
STP
2023-11-12 20:21:47 -05:00
parent 83e45b6860
commit 15c39e3c05
8 changed files with 322 additions and 508 deletions

View File

@@ -8,8 +8,9 @@ pub struct Ray {
}
impl Ray {
pub fn new(_a: Point3<f32>, _b: Vector3<f32>) -> Ray {
Ray { a: _a, b: _b }
pub fn new(a: Point3<f32>, b: Vector3<f32>) -> Ray {
let b = b.normalize();
Ray { a, b }
}
pub fn at_t(&self, t: f32) -> Point3<f32> {
self.a + self.b * t