the desired result is for the texture to be pretty much the same throughout the disk however it seems to only render properly at a few triangle shaped areas round the edge
disk.cpp
void disk::disk(int sides)
{
float interval = ( 2 * PI )/sides;
float angle = 0.0f;
groundtexture = SOIL_load_OGL_texture
(
"gfx/ground.png",
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_MIPMAPS | SOIL_FLAG_NTSC_SAFE_RGB | SOIL_FLAG_COMPRESS_TO_DXT
);
glBegin(GL_TRIANGLES);
for (int i = 0; i < sides; i++)
{
glBindTexture(GL_TEXTURE_2D,groundtexture);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexCoord2f(0.5, -0.5);
glVertex3f(0, 0, 0);
glTexCoord2f(cos(angle) / 2 + 0.5, - (sin(angle) / 2 + 0.5));
glVertex3f(cos(angle), sin(angle), 0);
glTexCoord2f(cos(angle + interval) / 2 + 0.5, -(sin(angle + interval) / 2 - 0.5));
glVertex3f(cos(angle + interval), sin(angle + interval), 0);
angle += interval;
}
glVertex3f(cos(0), sin(0), 0);
glEnd();
}
the disk does render but the texture does not render properly. with the edit suggested the disk does not texture right