Advertisement

tile-based texture on polygon

Started by October 03, 2004 11:03 AM
1 comment, last by indieboy 20 years, 1 month ago
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();

* leandro.
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.
Advertisement
hmmmmm

and do i use skins? sorry for the ignorance.. =)
* leandro.

This topic is closed to new replies.

Advertisement