Jump to content
  • Advertisement
Sign in to follow this  
Syranide

Texture coordinates (quickie)

This topic is 4833 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I couldn't find anything when I searched the documentation on this... simply... How are the texture coordinates defined? Is (0,0) in the image, (0,1) in the texture? (meaning that it is flipped vertically?)... or have I done something wrong? Logically it should be this way considering it is a left-hand side perspective.

Share this post


Link to post
Share on other sites
Advertisement
0,0 is 0,0!

I had a similar sounding problem starting out, where my textures were all rotated 90degrees.

My problem was I had mistakenly assigned the texture coordinate relative to the vertices - think I was starting on a different vertice for position and texture, then counting clockwise.

Share this post


Link to post
Share on other sites
Quote:
Original post by Syranide
How are the texture coordinates defined?


For the most part, texture coordinates are defined in the region 0.0 to 1.0. They are also, typically, defined as being "U" for horizontal and "V" for vertical, where U=0.0, V=0.0 is the top left of the texture and U=1.0, V=1.0 is the bottom right of the texture.

However, for the purpose of wrapping/mirroring a texture mapping, it is acceptable to go outside that range (you need to check the device's capabilities to determine how far you can go)

You might want to have a quick browse of the Texture Coordinates part of the SDK documentation...

hth
Jack

Share this post


Link to post
Share on other sites
"Logically it should be this way considering it is a left-hand side perspective."

Let me rephrase that to

Logically I'm kind of an idiot right now and thinks too much left-hand side, on top of that using a horizontally stretched image, thus not seeing that it has been flipped in horizontal too" :|

The problem was that I thought of left-hand side, so I put the lower texture coordinates as 0 and upper as 1...

Thank you all

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!