From cfa29edec45bd3eaaddecdd3a7a7d5120da7e6e1 Mon Sep 17 00:00:00 2001 From: neviyn Date: Sun, 8 Nov 2020 22:24:14 +0000 Subject: [PATCH] Converted fully to simplified transformations API --- src/raytracer_nim.nim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/raytracer_nim.nim b/src/raytracer_nim.nim index f7e5d9c..bf2ba60 100644 --- a/src/raytracer_nim.nim +++ b/src/raytracer_nim.nim @@ -1,4 +1,4 @@ -import "./tuple", "./canvas", "./matrix", "./transformations", math +import "./tuple", "./canvas", "./transformations", math type Projectile = object @@ -34,11 +34,10 @@ proc clock() = var world = canvas(200, 200) var p = point(0.0, 0.0, 1.0) let colour = colour(1, 1, 1) - let oneHourRotation = rotationY(PI / 6) for i in 0..11: let target = p.scale(60.0, 0.0, 60.0).translate(100.0, 0.0, 100.0) world.writePixel(target.x, target.z, colour) - p = oneHourRotation * p + p = p.rotateY(PI / 6) writeFile("clock.ppm", world.toPPM()) when isMainModule: