ft: tri support

This commit is contained in:
2026-04-30 16:28:16 +02:00
parent 388fbcbb8a
commit 27bdce5882
7 changed files with 204 additions and 12 deletions

View File

@@ -18,6 +18,7 @@ use crate::ray::Ray;
use crate::scenes::scene::Scene;
use crate::vec3::Vec3;
use dotenv::dotenv;
use log::warn;
use rand::RngExt;
// TODO: implement scene serialization
@@ -26,7 +27,8 @@ fn main() {
pretty_env_logger::init();
// TODO: use cli arg for scenefile
let json_file = "./scenes/scene.json";
let json_file = "./scenes/withTriangle.json";
// let json_file = "./scenes/scene.json";
let json_str = fs::read_to_string(json_file).expect("Reading specified scene file failed!");
let mut scene: Scene = serde_json::from_str(&json_str).unwrap();
scene.render();