Mercurial > games > semicongine
comparison examples/E03_hello_cube.nim @ 1136:71315636ba82
did: refactor naming in tons of places
author | sam <sam@basx.dev> |
---|---|
date | Tue, 04 Jun 2024 16:51:50 +0700 |
parents | d6c27f0ed3e4 |
children | 114f395b9144 |
comparison
equal
deleted
inserted
replaced
1135:74957cbf589b | 1136:71315636ba82 |
---|---|
2 import std/times | 2 import std/times |
3 | 3 |
4 import ../semicongine | 4 import ../semicongine |
5 | 5 |
6 const | 6 const |
7 TopLeftFront = newVec3f(-0.5'f32, -0.5'f32, -0.5'f32) | 7 TopLeftFront = NewVec3f(-0.5'f32, -0.5'f32, -0.5'f32) |
8 TopRightFront = newVec3f(0.5'f32, -0.5'f32, -0.5'f32) | 8 TopRightFront = NewVec3f(0.5'f32, -0.5'f32, -0.5'f32) |
9 BottomRightFront = newVec3f(0.5'f32, 0.5'f32, -0.5'f32) | 9 BottomRightFront = NewVec3f(0.5'f32, 0.5'f32, -0.5'f32) |
10 BottomLeftFront = newVec3f(-0.5'f32, 0.5'f32, -0.5'f32) | 10 BottomLeftFront = NewVec3f(-0.5'f32, 0.5'f32, -0.5'f32) |
11 TopLeftBack = newVec3f(0.5'f32, -0.5'f32, 0.5'f32) | 11 TopLeftBack = NewVec3f(0.5'f32, -0.5'f32, 0.5'f32) |
12 TopRightBack = newVec3f(-0.5'f32, -0.5'f32, 0.5'f32) | 12 TopRightBack = NewVec3f(-0.5'f32, -0.5'f32, 0.5'f32) |
13 BottomRightBack = newVec3f(-0.5'f32, 0.5'f32, 0.5'f32) | 13 BottomRightBack = NewVec3f(-0.5'f32, 0.5'f32, 0.5'f32) |
14 BottomLeftBack = newVec3f(0.5'f32, 0.5'f32, 0.5'f32) | 14 BottomLeftBack = NewVec3f(0.5'f32, 0.5'f32, 0.5'f32) |
15 const | 15 const |
16 cube_pos = @[ | 16 cube_pos = @[ |
17 TopLeftFront, TopRightFront, BottomRightFront, BottomLeftFront, # front | 17 TopLeftFront, TopRightFront, BottomRightFront, BottomLeftFront, # front |
18 TopLeftBack, TopRightBack, BottomRightBack, BottomLeftBack, # back | 18 TopLeftBack, TopRightBack, BottomRightBack, BottomLeftBack, # back |
19 TopLeftBack, TopLeftFront, BottomLeftFront, BottomLeftBack, # left | 19 TopLeftBack, TopLeftFront, BottomLeftFront, BottomLeftBack, # left |
20 TopRightBack, TopRightFront, BottomRightFront, BottomRightBack, # right | 20 TopRightBack, TopRightFront, BottomRightFront, BottomRightBack, # right |
21 TopLeftBack, TopRightBack, TopRightFront, TopLeftFront, # top | 21 TopLeftBack, TopRightBack, TopRightFront, TopLeftFront, # top |
22 BottomLeftFront, BottomRightFront, BottomRightBack, BottomLeftBack, # bottom | 22 BottomLeftFront, BottomRightFront, BottomRightBack, BottomLeftBack, # bottom |
23 ] | 23 ] |
24 R = newVec4f(1, 0, 0, 1) | 24 R = NewVec4f(1, 0, 0, 1) |
25 G = newVec4f(0, 1, 0, 1) | 25 G = NewVec4f(0, 1, 0, 1) |
26 B = newVec4f(0, 0, 1, 1) | 26 B = NewVec4f(0, 0, 1, 1) |
27 cube_color = @[ | 27 cube_color = @[ |
28 R, R, R, R, | 28 R, R, R, R, |
29 R * 0.5'f32, R * 0.5'f32, R * 0.5'f32, R * 0.5'f32, | 29 R * 0.5'f32, R * 0.5'f32, R * 0.5'f32, R * 0.5'f32, |
30 G, G, G, G, | 30 G, G, G, G, |
31 G * 0.5'f32, G * 0.5'f32, G * 0.5'f32, G * 0.5'f32, | 31 G * 0.5'f32, G * 0.5'f32, G * 0.5'f32, G * 0.5'f32, |