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();
tile-based texture on polygon
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:
* 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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement