Converted fully to simplified transformations API
This commit is contained in:
parent
98abd6f193
commit
cfa29edec4
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user