mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-18 00:27:02 +08:00
fix: correct texture coordinates
This commit is contained in:
@@ -57,14 +57,49 @@ constexpr float VERTICES_POS[6][6][3] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
constexpr float TEX_COORDS[6][6][2] = {
|
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,
|
// ===== front (z = +1) =====
|
||||||
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, 1.0f, // bottom left
|
||||||
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, // top left
|
||||||
0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f,
|
1.0f, 0.0f, // top right
|
||||||
0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f,
|
1.0f, 0.0f, // top right
|
||||||
0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f,
|
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] = {
|
constexpr float CUBE_VER[24] = {
|
||||||
0.0, 0.0, 0.0,
|
0.0, 0.0, 0.0,
|
||||||
|
|||||||
Reference in New Issue
Block a user