aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authoreug-vs <eugene@eug-vs.xyz>2021-10-25 15:39:58 +0300
committereug-vs <eugene@eug-vs.xyz>2021-10-25 15:40:23 +0300
commit67d7492477808dc1765b1a9ed493dee79dff9320 (patch)
treeb472d485c79b164eb472e609d2daaa05258993bf /src/main.rs
downloadpistol-67d7492477808dc1765b1a9ed493dee79dff9320.tar.gz
feat: initial commit
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..3bf9bb2
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,27 @@
+mod vector;
+mod camera;
+mod canvas;
+use std::f32::consts::PI;
+
+use crate::{camera::{Buffer, Camera}, vector::Vector};
+
+trait Object {
+ fn sdf(&self, point: Vector) -> f32;
+}
+
+fn main() {
+ let mut cam = Camera {
+ position: Vector { x: 0.0, y: 0.0, z: 0.0 },
+ direction: Vector { x: 1.0, y: 0.0, z: 0.0 },
+ angle: PI / 2.0,
+ distance: 1.0,
+ aspect_ratio: 1.0,
+ brightness: 10.0,
+ buffer: Buffer([['.'; 60]; 30])
+ };
+
+ for _i in 0..60 {
+ cam.render();
+ println!("{}", cam.buffer);
+ }
+}