diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-11-28 14:39:20 -0700 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-11-28 14:39:20 -0700 |
commit | 3197f9e40cd7079e19990c64c98de667e2457d75 (patch) | |
tree | 2d9eb3fbc17d453ee33e478bafb9936beff12eb3 /src/cube.cpp | |
parent | 1b96b0211ed98afba515f0ac9880116f79ead2e5 (diff) | |
download | gbarubik-3197f9e40cd7079e19990c64c98de667e2457d75.tar.gz gbarubik-3197f9e40cd7079e19990c64c98de667e2457d75.zip |
draw the whole cube
Diffstat (limited to 'src/cube.cpp')
-rw-r--r-- | src/cube.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cube.cpp b/src/cube.cpp index c181794..60422a2 100644 --- a/src/cube.cpp +++ b/src/cube.cpp @@ -1,8 +1,12 @@ #include "cube.hpp" Cube::Cube() { - for (std::uint8_t i = 0; i < 8; ++i) - vertices.add({(i >> 2) & 1, (i >> 1) & 1, i & 1}); + for (std::uint8_t i = 0; i < 8; ++i) { + VECTOR vertex = {int2fx((((i >> 2) & 1) << 1) - 1), + int2fx((((i >> 1) & 1) << 1) - 1), + int2fx(((i & 1) << 1) - 1)}; + vertices.add(vertex); + } triangles.add({{0, 4, 5}, 1}); triangles.add({{0, 1, 5}, 1}); |