From c50997144bb4d006ca878a1cfe24a9aeefac2e79 Mon Sep 17 00:00:00 2001 From: Michael Zhang Date: Tue, 4 Jan 2022 02:29:43 -0600 Subject: [PATCH] More --- README.md | 1 + src/main.zig | 1 + src/ray.zig | 6 ++++++ src/{point.zig => vec3.zig} | 4 ++-- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 README.md create mode 100644 src/ray.zig rename src/{point.zig => vec3.zig} (81%) diff --git a/README.md b/README.md new file mode 100644 index 0000000..2dda5a4 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +Based on the article https://raytracing.github.io/books/RayTracingInOneWeekend.html diff --git a/src/main.zig b/src/main.zig index 6531f74..1f1d0f7 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1,4 +1,5 @@ const std = @import("std"); +const vec3 = @import("vec3.zig"); pub fn main() anyerror!void { const stdout = std.io.getStdOut().writer(); diff --git a/src/ray.zig b/src/ray.zig new file mode 100644 index 0000000..055b22d --- /dev/null +++ b/src/ray.zig @@ -0,0 +1,6 @@ +const vec3 = @import("vec3.zig"); + +pub const ray = struct { + origin : vec3.point3, + dir : vec3.vec3, +}; diff --git a/src/point.zig b/src/vec3.zig similarity index 81% rename from src/point.zig rename to src/vec3.zig index 10f8f12..d05b99a 100644 --- a/src/point.zig +++ b/src/vec3.zig @@ -1,4 +1,4 @@ -const vec3 = struct { +pub const vec3 = struct { x: f64, y: f64, z: f64, @@ -12,4 +12,4 @@ const vec3 = struct { } }; -const color = vec3; +pub const color = vec3;