Home > Back-end >  D3D11 to rectangular texture UV mapping is not normal, which bosses know help me have a look at this
D3D11 to rectangular texture UV mapping is not normal, which bosses know help me have a look at this

Time:09-26

I create a rectangle, want to put this in the above picture

Vertex and index reads
VertexPosColor are []=
{
F {{0.5, 0.5 f, 0}, {0.5 f to 0.0 f, f 0.0, 1.0 f}, {0.0 f to 0.0 f}},
F {{0.5, 0.5 f, 0}, {0.5 f to 0.0 f to 0.0 f to 1.0 f}, {1.0 f to 0.0 f}},
{{0.5 f to 0.5 f, 0}, {0.0 0.5 f, f, f 0.0, 1.0 f}, {1.0 f to 1.0 f}},
{{0.5 f, 0.5 f, 0}, {0.0 0.5 f, f, f 0.0, 1.0 f}, {0.0 f to 1.0 f}}
};
UINT indices []={0, 1, 2, 0, 2, 3};
The result is that

I think I wrote the UV coordinates to the ah, what's wrong with this, please, help me to look at, very grateful,

CodePudding user response:


Now I only use vertex buffers, and then change the second triangle UV found abnormal
no matter how to changeThe last point UV seemingly doesn't work!! ??

VertexPosColor are []=
{
//right triangle
F {{0.5, 0.5 f, 0}, {0.5 f to 0.0 f, f 0.0, 1.0 f}, {0.0 f to 0.0 f}},
F {{0.5, 0.5 f, 0}, {0.5 f to 0.0 f to 0.0 f to 1.0 f}, {1.0 f to 0.0 f}},
{{0.5 f to 0.5 f, 0}, {0.0 0.5 f, f, f 0.0, 1.0 f}, {1.0 f to 1.0 f}},

//lower left triangle
F {{0.5, 0.5 f, 0}, {0.5 f to 0.0 f, f 0.0, 1.0 f}, {0.0 f to 1.0 f}},//only this two point
{{0.5 f to 0.5 f, 0}, {0.0 0.5 f, f, f 0.0, 1.0 f}, {1.0 f to 0.0 f}},//UV work
{{0.5 f, 0.5 f, 0}}//this point UV doesn't work??????? !!!!!!!!!
};
  • Related