I am trying to texture a triangle based on the rastertek tutorial 5, and I copied and pasted all the code (while reading through obviously) and then fixed the errors to work with windows 8. Once I got it running, I got a nasty texture problem, as seen in the screenshots. I have absolutely no idea whats going on. It looked like a uv mapping or wrapping issue, but I checked all the different wrap modes and the uv coordinates and they are all fine.
The first screenshot (the brown one) is the texture from the tutorial. The second screenshot (grey) is my own sample texture, which has a single pixel wide line down each of the 4 sides, one in each of red, green, blue, and black.
[attachment=11432:DXEngine 2012-09-23 23-50-36-08.bmp]
[attachment=11433:DXEngine 2012-09-23 23-50-47-91.bmp]
Texturing a triangle, completely lost
So there it is, staring me right in the face like I am a complete idiot.
[source lang="cpp"]vertices[2].position = XMFLOAT3(3.0f, -3.0f, 0.0f); // Bottom right.
vertices[1].texture = XMFLOAT2(0.5f, 0.0f);[/source]
so I fix it.
Then this.
[attachment=11434:DXEngine 2012-09-24 01-20-48-95.bmp]
[source lang="cpp"]vertices[2].position = XMFLOAT3(3.0f, -3.0f, 0.0f); // Bottom right.
vertices[1].texture = XMFLOAT2(0.5f, 0.0f);[/source]
so I fix it.
Then this.
[attachment=11434:DXEngine 2012-09-24 01-20-48-95.bmp]
Traditionally you don't: the usefulness of a forum comes from the fact that people can still learn from fixes well after the original poster fixed their own problem ;)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement