Mercurial > games > semicongine
diff examples/hello_cube.nim @ 39:0cb294c5d2fd
fix: hello cube, add: run_all command
author | Sam <sam@basx.dev> |
---|---|
date | Wed, 18 Jan 2023 13:49:12 +0700 |
parents | c3c963e7c1a6 |
children | 2771db8d4276 |
line wrap: on
line diff
--- a/examples/hello_cube.nim Wed Jan 18 09:52:03 2023 +0700 +++ b/examples/hello_cube.nim Wed Jan 18 13:49:12 2023 +0700 @@ -53,7 +53,6 @@ uniforms.projection.value = perspective(float32(PI / 4), float32(engine.vulkan.frameDimension.width) / float32(engine.vulkan.frameDimension.height), 0.1'f32, 100'f32) for buffer in pipeline.uniformBuffers: buffer.updateData(uniforms) - echo uniforms.projection.value const TopLeftFront = Vec3([ -0.5'f32, -0.5'f32, -0.5'f32]) @@ -83,8 +82,10 @@ ] var tris: seq[array[3, uint16]] -# for i in 0'u16 ..< 6'u16: - # let off = i * 4 +for i in 0'u16 ..< 6'u16: + let off = i * 4 + tris.add [off + 0'u16, off + 1'u16, off + 2'u16] + tris.add [off + 2'u16, off + 3'u16, off + 0'u16] var off = 0'u16 * 4 # tris.add [off + 0'u16, off + 1'u16, off + 2'u16] # tris.add [off + 2'u16, off + 3'u16, off + 0'u16]