Jump to content

  • Log In with Google      Sign In   
  • Create Account

texture positioning question


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 Jesper T   Members   -  Reputation: 322

Like
Likes
Like

Posted 21 July 2001 - 05:08 AM

Im using a 256x256 texture in a GL_QUAD thingy.. I know how to map the texture onto the quad, but I am trying to map the quad with parts of the texture only ( eventually making the texture cover several quads ) I tried to change the values in the glTexCoord2f() but then suddenly the entire quad became mapped with one color instead of the part of the texture i wanted to cover it... so the question is: is the way im trying to do this possible at all, or do i have to split up the texture to make it work ??

Sponsor:

#2 Pseudo   Members   -  Reputation: 100

Like
Likes
Like

Posted 21 July 2001 - 05:17 AM

you have to set the texture coordinates for your verticies so that they don''t use the whole texture. Tex. coords are in the range of 0.0 - 1.0 so if you have a texture coord of 1.0, it means the 256th pixel on your texture map. using this, if you want a quad with only a 4th of the texture you could put the coords to

0.0, 0.0
0.0, 0.5
0.5, 0.5
0.5, 0.0

I suggest playing around with this idea and you should get it to work the way you want.

#3 Jesper T   Members   -  Reputation: 322

Like
Likes
Like

Posted 21 July 2001 - 06:57 AM

yup, found out what was wrong, I had just mixed up the corners




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