comparison examples/alotof_triangles.nim @ 58:8287a91e5d56

did: refactor Matrix names
author Sam <sam@basx.dev>
date Fri, 20 Jan 2023 16:36:52 +0700
parents 547f3a374271
children d7d9420ba675
comparison
equal deleted inserted replaced
57:547f3a374271 58:8287a91e5d56
14 dt: Descriptor[float32] 14 dt: Descriptor[float32]
15 15
16 proc globalUpdate(engine: var Engine, dt: float32) = 16 proc globalUpdate(engine: var Engine, dt: float32) =
17 discard 17 discard
18 18
19 proc randomtransform(): Mat33[float32] = 19 proc randomtransform(): TMat33[float32] =
20 let randomscale = scale2d(float32(rand(1.0) + 0.5), float32(rand(1.0) + 0.5)) 20 let randomscale = scale2d(float32(rand(1.0) + 0.5), float32(rand(1.0) + 0.5))
21 let randomrotate = rotate2d(float32(rand(2 * PI))) 21 let randomrotate = rotate2d(float32(rand(2 * PI)))
22 let randomtranslate = translate2d(float32(rand(1.6) - 0.8), float32(rand(1.6) - 0.8)) 22 let randomtranslate = translate2d(float32(rand(1.6) - 0.8), float32(rand(1.6) - 0.8))
23 result = randomtranslate * randomrotate * randomscale 23 result = randomtranslate * randomrotate * randomscale
24 24