diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-09 07:49:42 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-09 07:49:42 +0200 |
commit | f6d822abd400d7a61ccacb49df75212132bcec66 (patch) | |
tree | 7444b5f8ace3ea97804b55e3247af09da8bfca55 | |
parent | 5b97a6de06e7c44e7960159dc98c54860170203b (diff) |
a
-rw-r--r-- | draw/wireframe-box.cpp | 16 | ||||
-rw-r--r-- | draw/wireframe-mesh.hpp | 1 | ||||
-rw-r--r-- | main/main.cpp | 4 |
3 files changed, 11 insertions, 10 deletions
diff --git a/draw/wireframe-box.cpp b/draw/wireframe-box.cpp index e03c8ca2..c5e4d9ac 100644 --- a/draw/wireframe-box.cpp +++ b/draw/wireframe-box.cpp @@ -16,14 +16,14 @@ box::vertex_array box::make_vertex_array() const const auto Cy_0 = center[1] - Sy, Cy_1 = center[1] + Sy; const auto Cz_0 = center[2] + 0, Cz_1 = center[2] + Sz; return {{ - {Cx_0, Cy_0, Cz_0}, // (0) left front bottom - {Cx_1, Cy_0, Cz_0}, // (1) right front bottom - {Cx_0, Cy_1, Cz_0}, // (2) left back bottom - {Cx_1, Cy_1, Cz_0}, // (3) right back bottom - {Cx_0, Cy_0, Cz_1}, // (4) left front top - {Cx_1, Cy_0, Cz_1}, // (5) right front top - {Cx_0, Cy_1, Cz_1}, // (6) left back top - {Cx_1, Cy_1, Cz_1}, // (7) right back top + {Cx_0, Cy_0, Cz_0}, // (0) front left bottom + {Cx_1, Cy_0, Cz_0}, // (1) front right bottom + {Cx_0, Cy_1, Cz_0}, // (2) back left bottom + {Cx_1, Cy_1, Cz_0}, // (3) back right bottom + {Cx_0, Cy_0, Cz_1}, // (4) front left top + {Cx_1, Cy_0, Cz_1}, // (5) front right top + {Cx_0, Cy_1, Cz_1}, // (6) back left top + {Cx_1, Cy_1, Cz_1}, // (7) back right top }}; } diff --git a/draw/wireframe-mesh.hpp b/draw/wireframe-mesh.hpp index 016a92af..f9c5e369 100644 --- a/draw/wireframe-mesh.hpp +++ b/draw/wireframe-mesh.hpp @@ -56,6 +56,7 @@ wireframe_mesh<T>::wireframe_mesh() : template <wireframe::traits T> void wireframe_mesh<T>::draw(tile_shader& shader, T x) { _vertex_buffer.setSubData(0, x.make_vertex_array()); + x.on_draw(); mesh_base::draw(shader); } diff --git a/main/main.cpp b/main/main.cpp index ec065523..431bbefd 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -70,11 +70,11 @@ void app::draw_wireframe_quad() void app::draw_wireframe_box() { - constexpr float LINE_WIDTH = 1; + constexpr float LINE_WIDTH = 1.5; constexpr auto X = TILE_SIZE[0], Y = TILE_SIZE[1]; constexpr float N = TILE_MAX_DIM/2.f; - constexpr Vector3 size{TILE_SIZE[0], TILE_SIZE[1], TILE_SIZE[2]}; + constexpr Vector3 size{TILE_SIZE[0], TILE_SIZE[1], TILE_SIZE[2]*1.5f}; const Vector3 center1{X*(N+3), Y*(N+2), 0}, center2{X*(N-2), Y*(N-4), 0}; _shader.set_tint({0, 1, 0, 1}); |