Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Waldoo

Multi-Texture mapping question

This topic is 6017 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

How do you put several separated texture mappings on a single square? Waldoo Edited by - waldoo on January 29, 2002 2:00:52 AM

Share this post


Link to post
Share on other sites
Advertisement
  
glActiveTexture(GL_TEXTURE0); // activate first textuer unit

glBindTexture(GL_TEXTURE_2D, tex0); // bind texture to first unit

glActiveTexture(GL_TEXTURE1); // activate second texture unit

glBindTexture(GL_TEXTURE_2D, tex1); // bind texture to second unit


Then you need to specify texture coordinates for both units.
  
glBegin(GL_QUADS);
glMultiTexCoord2f(GL_TEXTURE0, 0, 0); // coordinates for first texture

glMultiTexCoord2f(GL_TEXTURE1, 0, 0); // coordinates for second texture

glVertex2f(...); // first vertex

... // and so on, for each vertex

glEnd();

Share this post


Link to post
Share on other sites
sorry to ruin your dream.. but there IS init code.. and quite ugly one.. Look at tutorial 22... it''s all there...

There are more worlds than the one that you hold in your hand...

Share this post


Link to post
Share on other sites
I didnt mean that. What I mean is several separated pictures on a square. A picture of anything on each corner (4 pictures).

Waldoo

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!