Jump to content

  • Log In with Google      Sign In   
  • Create Account

Texture getting distorted


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
2 replies to this topic

#1 noatom   Members   -  Reputation: 785

Like
0Likes
Like

Posted 13 October 2012 - 03:35 AM

So the plan goes like this:

I have a rectangle that stretches from one side of the screen to the other (in width).And the height is 100.

The texture coords go like this:
0.0f,1.0f
1.0f,1.0f
0.0f,0.0f
1.0f,0.0f

So at my current resolution,the width of the rectangle would be 1280 and of course, 100 in height.

I'm trying to set this image as the texture to be used on that rectangle:
http://www.flickr.com/photos/zooboing/5236655811/sizes/o/in/photostream/


The problem is that the image gets very distorted! What is the solution? I tried tiling too,the same result,ugly distorsion!

Sponsor:

#2 apatriarca   Crossbones+   -  Reputation: 1765

Like
2Likes
Like

Posted 13 October 2012 - 06:20 AM

You have a square texture and you are rendering it on top of a rectangle with a large ratio between the two sides (1280:100). I would be very surprised if there was no distortion. You should change your texture coordinates so that several copies of the texture are inserted in that rectangle (you should also set your texture address mode to wrap). Your texture coordinates can be for example:

0.0f, 1.0f
12.8f, 1.0f
0.0f, 0.0f
12.8f, 0.0f

#3 noatom   Members   -  Reputation: 785

Like
0Likes
Like

Posted 13 October 2012 - 09:02 AM

Thanks,did what you said with the coords and used the wrap mode,it worked.




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