I'm making a skybox (cube with different texture on each of its 6 faces) here's what I do :
I define my vertices :
const float vertices[8u][3u] = {
{-1.0f, -1.0f, -1.0f},
{-1.0f, -1.0f, 1.0f},
{-1.0f, 1.0f, -1.0f},
{-1.0f, 1.0f, 1.0f},
{1.0f, -1.0f, -1.0f},
{1.0f, -1.0f, 1.0f},
{1.0f, 1.0f, -1.0f},
{1.0f, 1.0f, 1.0f}
};
I define my triangles (quads are not available in ES version) based on the vertices array :
const unsigned short elements[8u][3u] = {
{4u, 6u, 2u},
{4u, 0u, 2u},
{6u, 3u, 2u},
{6u, 3u, 7u},
{7u, 1u, 5u},
{7u, 1u, 3u},
{5u, 0u, 4u},
{5u, 0u, 1u}
};
As I understood I now need to define my texture coordinates, I tried many different things, for now it looks like this :
float texCoords[4u][2u] = {
{0.0f, 0.0f},
{1.0f, 0.0f},
{1.0f, 1.0f},
{0.0f, 1.0f}
};
Edit: The skybox absolutely doesn't display itself, I only see a 2d flat image where my texture is repeated in a strange way. Absolutly no cube
The drawing part is working, I think my problem is based on the Texture coordinate, Am I right ? what did I've made wrong ?