fixed cylinders, added another lua scene
This commit is contained in:
+1
-1
@@ -86,7 +86,7 @@ fn default_scene3() -> Scene {
|
||||
|
||||
fn main() {
|
||||
// get scene and camera
|
||||
let scene = scene_from_file("scenes/randomspheres.lua".to_owned()).unwrap();
|
||||
let scene = scene_from_file("scenes/smolgalaxy.lua".to_owned()).unwrap();
|
||||
let cam = default_cam();
|
||||
|
||||
// get stats on the scene we're about to render
|
||||
|
||||
@@ -15,9 +15,9 @@ impl Cylinder {
|
||||
|
||||
impl Obj for Cylinder {
|
||||
fn distance_to(&self, point: Vec3) -> f64 {
|
||||
Vec3::new(self.center.x(), 0., self.center.z()).distance_to(point) - self.radius
|
||||
Vec3::new(self.center.x(), point.y(), self.center.z()).distance_to(point) - self.radius
|
||||
}
|
||||
fn normal_at(&self, point: Vec3) -> Vec3 {
|
||||
point - Vec3::new(self.center.x(), 0.,self.center.z())
|
||||
point - Vec3::new(self.center.x(), point.y(),self.center.z())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user