Struggling a bit with the texturing in DirectX. Hope someone has come across similar issues. Note that the stuff works! It just looks awful ugly right now!
I will draw out a list of triangles. I use CustomVertex.PositionColoredTextured[] type and put Tu/Tv mapping parameters as below
Code:
if (count == 1)
{
triangleList[i].Tu = 0;
triangleList[i].Tv = 0;
}
if (count == 2)
{
triangleList[i].Tu = 0;
triangleList[i].Tv = 1;
}
if (count == 3)
{
triangleList[i].Tu = 1;
triangleList[i].Tv = 1;
}
The triangles are drawn with
Code:
device.DrawUserPrimitives(PrimitiveType.TriangleList, triangleList.Length / 3, triangleList);
The problem is that:
- I have no idea how the triangle looks like. The forms may be different. An edge may be 20 cm, second 2 meters, third 3 meters. 1/1/1 or in other settings.
- Today, the texture "ripped" and changed to fit the triangle shape. I would like ideally, the texture should be "tiles". Thats placed next to each other and thus never scaled or stretched differently. I want a smooth surface without edges, etc. Is this possible to achieve?
Any ideas?
Bookmarks