wip: normal material
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
use log::{info, warn};
|
||||
|
||||
use crate::objects::hit::Hit;
|
||||
use crate::objects::traits::Hittable;
|
||||
use crate::ray::Ray;
|
||||
@@ -56,7 +54,7 @@ impl Triangle {
|
||||
|
||||
let diff = (a4 - a1 - a2 - a3).abs();
|
||||
if diff < 0.001 {
|
||||
return Some(Hit::new(t, p, normal, material, normal.dot(&-r.dir()) < 0.));
|
||||
return Some(Hit::new(t, p, normal, material, normal.dot(&-r.dir()) > 0.));
|
||||
} else {
|
||||
return None;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user