Texturing a triangle, completely lost

Started by
3 comments, last by viper110110 11 years, 6 months ago
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]
Advertisement
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]
Fixed, I'm dumb. How do I delete this thread?
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 ;)

Hazard Pay :: FPS/RTS in SharpDX (gathering dust, retained for... historical purposes)
DeviantArt :: Because right-brain needs love too (also pretty neglected these days)

Well let me just tell everybody to not code when you are tired. I guess that's the lesson to be learned here. Stupid mistakes.

This topic is closed to new replies.

Advertisement