Jump to content

  • Log In with Google      Sign In   
  • Create Account


Texturing a triangle, completely lost


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 viper110110   Members   -  Reputation: 577

Like
0Likes
Like

Posted 23 September 2012 - 09:59 PM

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.

Attached File  DXEngine 2012-09-23 23-50-36-08.bmp   1.37MB   40 downloads
Attached File  DXEngine 2012-09-23 23-50-47-91.bmp   1.37MB   33 downloads

Sponsor:

#2 viper110110   Members   -  Reputation: 577

Like
0Likes
Like

Posted 23 September 2012 - 11:21 PM

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.

Attached File  DXEngine 2012-09-24 01-20-48-95.bmp   1.37MB   34 downloads

Edited by viper110110, 24 September 2012 - 08:42 AM.


#3 viper110110   Members   -  Reputation: 577

Like
0Likes
Like

Posted 23 September 2012 - 11:23 PM

Fixed, I'm dumb. How do I delete this thread?

#4 BCullis   Crossbones+   -  Reputation: 1813

Like
1Likes
Like

Posted 24 September 2012 - 08:41 AM

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
DeviantArt :: Because right-brain needs love too

#5 viper110110   Members   -  Reputation: 577

Like
1Likes
Like

Posted 24 September 2012 - 08:42 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS