Original Post
Hi,
I have 8 vertex and with the indices I create a cube. The cube shows correctly but the texture doesn't show correctly.
This is my code of the vertex with normals and uv texture.
How must I place texture coordinates??
Thanks.
I have 8 vertex and with the indices I create a cube. The cube shows correctly but the texture doesn't show correctly.
This is my code of the vertex with normals and uv texture.
struct CUSTOMVERTEX {
FLOAT x, y, z;
FLOAT nx, ny, nz;
FLOAT tu, tv;
};
CUSTOMVERTEX cube[] = {
{-1.0f, -1.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f}, //v1
{-1.0f, 1.0f, -1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f}, //v2
{1.0f, 1.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f},
{1.0f, -1.0f, -1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f},
{-1.0f, -1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f},
{1.0f, -1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f},
{1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f},
{-1.0f, 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f}
};
How must I place texture coordinates??
Thanks.