From bc0d4bfcf6460f41188867acce907f6499ab8ff3 Mon Sep 17 00:00:00 2001 From: zhenyan121 <3367366583@qq.com> Date: Tue, 14 Apr 2026 22:55:04 +0800 Subject: [PATCH] fix: correct texture coordinates --- include/Cubed/config.hpp | 51 +++++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/include/Cubed/config.hpp b/include/Cubed/config.hpp index 95d28a3..caaeac2 100644 --- a/include/Cubed/config.hpp +++ b/include/Cubed/config.hpp @@ -57,14 +57,49 @@ constexpr float VERTICES_POS[6][6][3] = { }; constexpr float TEX_COORDS[6][6][2] = { - 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, - - }; + // ===== front (z = +1) ===== + 0.0f, 1.0f, // bottom left + 0.0f, 0.0f, // top left + 1.0f, 0.0f, // top right + 1.0f, 0.0f, // top right + 1.0f, 1.0f, // bottom right + 0.0f, 1.0f, // bottom left + // ===== right (x = +1) ===== + 0.0f, 1.0f, // bottom front + 1.0f, 1.0f, // bottom back + 1.0f, 0.0f, // top back + 1.0f, 0.0f, // top back + 0.0f, 0.0f, // top front + 0.0f, 1.0f, // bottom front + // ===== back (z = -1) ===== + 1.0f, 1.0f, // bottom left + 0.0f, 1.0f, // bottom right + 0.0f, 0.0f, // top right + 0.0f, 0.0f, // top right + 1.0f, 0.0f, // top left + 1.0f, 1.0f, // bottom left + // ===== left (x = -1) ===== + 1.0f, 1.0f, // bottom back + 0.0f, 1.0f, // bottom front + 0.0f, 0.0f, // top front + 0.0f, 0.0f, // top front + 1.0f, 0.0f, // top back + 1.0f, 1.0f, // bottom back + // ===== top (y = +1) ===== + 0.0f, 0.0f, // back left + 1.0f, 0.0f, // back right + 1.0f, 1.0f, // front right + 1.0f, 1.0f, // front right + 0.0f, 1.0f, // front left + 0.0f, 0.0f, // back left + // ===== bottom (y = -1) ===== + 0.0f, 0.0f, // front left + 1.0f, 0.0f, // front right + 1.0f, 1.0f, // back right + 1.0f, 1.0f, // back right + 0.0f, 1.0f, // back left + 0.0f, 0.0f, // front left +}; constexpr float CUBE_VER[24] = { 0.0, 0.0, 0.0,