diff --git a/README.md b/README.md index 9322796..fcdc4c4 100644 --- a/README.md +++ b/README.md @@ -21,16 +21,16 @@ The following Rust code draws the cube which is included as an example in the original `ln` repo. ```rust -use raydeon::shapes::RectPrism; +use raydeon::shapes::AxisAlignedCuboid; use raydeon::{Camera, Scene, WPoint3, WVec3}; use std::sync::Arc; -fn main() { - env_logger::Builder::from_default_env() - .format_timestamp_nanos() - .init(); +env_logger::Builder::from_default_env() + .format_timestamp_nanos() + .init(); - let scene = Scene::new(vec![Arc::new(RectPrism::new( +fn main() { + let scene = Scene::new(vec![Arc::new(AxisAlignedCuboid::new( WVec3::new(-1.0, -1.0, -1.0), WVec3::new(1.0, 1.0, 1.0), ))]); @@ -45,7 +45,7 @@ fn main() { let znear = 0.1; let zfar = 10.0; - let camera = Camera::look_at(eye, focus, up).perspective(fovy, width, height, znear, zfar); + let camera = Camera::new().look_at(eye, focus, up).perspective(fovy, width, height, znear, zfar); let paths = scene.attach_camera(camera).render(); diff --git a/raydeon/src/lib.rs b/raydeon/src/lib.rs index 02a8048..510dc62 100644 --- a/raydeon/src/lib.rs +++ b/raydeon/src/lib.rs @@ -1,3 +1,4 @@ +#[doc = include_str!("../../README.md")] pub(crate) mod bvh; pub mod camera; pub mod path;