Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Don't forget to read Tuesday's email newsletter for your chance to win a free copy of Construct 2!


Just a Quick Texture problem


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 Marvin   Members   -  Reputation: 127

Like
Likes
Like

Posted 13 October 2001 - 08:13 AM

How do i stretch a texture over more than 1 polygon, eg have half on one polygon and half of the other, ive tried messing around with texture coordinates, do i have to play around with glTexParameter as well? Thanks

Sponsor:

#2 Lunatic Raven   Members   -  Reputation: 122

Like
Likes
Like

Posted 13 October 2001 - 08:21 AM

Well, its rather really simple. You need to mess with the Texture Coordinates.

And example could be this

Say you have two quads beside each other, and you want half of the texture to be on one, and have to be on the other, you would do this.

  
glBegin(GL_QUADS);
// Quad One, with half of the one texture

glTexCoord2f(0, 0);
glVertex3f(-1, -1, -5);
glTexCoord2f(0.5, 0);
glVertex3f(0, -1, -5);
glTexCoord2f(0.5, 1);
glVertex3f(0, 1, -5);
glTexCoord2f(0, 1);
glVertex3f(-1, 1, -5);

// Quad Two, with half of the one texture

glTexCoord2f(0.5, 0);
glVertex3f(0, -1, -5);
glTexCoord2f(1, 0);
glVertex3f(1, -1, -5);
glTexCoord2f(1, 1);
glVertex3f(1, 1, -5);
glTexCoord2f(0.5, 1);
glVertex3f(0, 1, -5);

glEnd();


#3 Marvin   Members   -  Reputation: 127

Like
Likes
Like

Posted 13 October 2001 - 08:34 AM

yes, thats just what i''ve been trying :/

maybe its because i want to tile the texture and have it repear, as in my other post at the mo if almost looks as if the texture''s being clamped.

#4 Marvin   Members   -  Reputation: 127

Like
Likes
Like

Posted 13 October 2001 - 08:48 AM

Ok heres the actual problem..

as you may see in the picture bellow, the texture isnt stretched at all, i need it stretched accross the poly's where the line is.

The picture bellow is using the texture coordinate system explained above.

Any ideas? it looks like clamping but clamping is off

if it helps im using Vertex Arrays and MultiTexturing

Thanks



Edited by - Marvin on October 13, 2001 3:48:49 PM

#5 Marvin   Members   -  Reputation: 127

Like
Likes
Like

Posted 13 October 2001 - 10:27 AM

Fixed, all it needed was 2 little (float) casts




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