Jump to content
  • Advertisement
Sign in to follow this  
indieboy

tile-based texture on polygon

This topic is 5039 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 can i apply some tile-based texture on a polygon? Is there any way to easly do that ? Do i have to calculate all points? if so, i just learned how to map 4 points (0,0; 0,1; 1,1; 0,0) Anyway, this is the the code for my polygon:
int topLeft=glGenLists(1);    
    glNewList(topLeft,GL_COMPILE);
    glBegin(GL_POLYGON);
    for(float i = PI/6; i < (PI )* 1; i+= PI/6)
    {
        glVertex3f( cos(i) * topSize, baseHeight,  sin(i)* topSize);
    }
    glVertex3f( -(topSize/5) * topSize, baseHeight, sin(PI -(PI/6))* topSize);
    glVertex3f( (topSize/5) * topSize, baseHeight, sin(PI -(PI/6))* topSize);
    glEnd();
    glEndList();

Share this post


Link to post
Share on other sites
Advertisement
If you want to tile a texture on a polygon lets say 4 times you put instead of 1.0, 4.0..But if you're using skins than you must know the offset of every skin you have and use that coordinates.

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.

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!