Sign in to follow this  

Texturing a triangle, completely lost

Recommended Posts

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]

Share this post

Link to post
Share on other sites
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] Edited by viper110110

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this