aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 3f4dd4a..5675fac 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -15,16 +15,18 @@ use camera::Camera;
use renderer::Renderer;
use sdf::{Gear, Object, SDBox, Sphere};
+const FPS: i32 = 60;
+
fn main() {
// This vector will later be built
// by parsing a JSON scene
let mut renderer = Renderer::new(
- Buffer::from_height(50.0, 3.0),
+ Buffer::from_height(100.0, 3.0),
Camera::new(Vector3::new(-4.0, 0.0, 0.0), Vector3::zero(), PI / 2.0, 1.0),
vec![
Box::new(Sphere {
center: Vector3::zero(),
- radius: 0.4,
+ radius: 1.1,
}),
Box::new(Gear {
center: Vector3::zero(),
@@ -32,6 +34,12 @@ fn main() {
thickness: 0.4,
turn_rate: 30.0,
}),
+ Box::new(Gear {
+ center: Vector3::unit_y() * 4.90 - Vector3::unit_z() * 0.65,
+ radius: 2.0,
+ thickness: 0.4,
+ turn_rate: -30.0,
+ }),
Box::new(SDBox {
center: Vector3::new(2.0, 2.0, 0.0),
size: Vector3::from_value(1.0),
@@ -40,6 +48,7 @@ fn main() {
);
initscr();
+ timeout(1000 / FPS);
let mut time = 0.0;