QuinnJohns
November 28th, 2005, 06:25 AM
Hello, I'm trying to utilize a texture on a tesselated surface in my display list. Which isn't obtaining the texture. The same texture is working on my other surfaces - just not tesselated ones.
double cubeside[4][3] =
{
8, 0, 8,
8, 0, -8,
-8, 0, -8,
-8, 0, 8
};
double window[14][3] =
{
0, 0, 2,
-1.5, 0, 1.7,
-1.7, 0, 0.5,
-1.7, 0, -2.0,
1.7, 0, -2.0,
1.7, 0, 0.5,
1.5, 0, 1.7,
0, 0, 2,
-1.5, 0, 1.7,
-1.7, 0, 0.5,
-1.7, 0, -2.0,
1.7, 0, -2.0,
1.7, 0, 0.5,
1.5, 0, 1.7,
};
glBindTexture(GL_TEXTURE_2D, g_stoneTexture);
glPushMatrix();
glRotated(90,0.0,0.0,1.0);
gluTessProperty(tess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_POSITIVE);
gluTessBeginPolygon(tess, NULL);
gluTessBeginContour(tess);
// glTexCoord2f(1.0, 1.0); Is this where I would put it?
gluTessVertex(tess, cubeside[0], cubeside[0]);
// glTexCoord2f(1.0, 0.0); Is this where I would put it?
gluTessVertex(tess, cubeside[1], cubeside[1]);
// glTexCoord2f(0.0, 0.0); Is this where I would put it?
gluTessVertex(tess, cubeside[2], cubeside[2]);
// glTexCoord2f(0.0, 1.0); Is this where I would put it?
gluTessVertex(tess, cubeside[3], cubeside[3]);
gluTessEndContour(tess);
gluTessBeginContour(tess);
gluTessVertex(tess, window[0], window[0]);
gluTessVertex(tess, window[1], window[1]);
gluTessVertex(tess, window[2], window[2]);
gluTessVertex(tess, window[3], window[3]);
gluTessVertex(tess, window[4], window[4]);
gluTessVertex(tess, window[5], window[5]);
gluTessVertex(tess, window[6], window[6]);
gluTessEndContour(tess);
gluTessEndPolygon(tess);
glPopMatrix();
Any advice on what I should do, would be greatly appreciated.
double cubeside[4][3] =
{
8, 0, 8,
8, 0, -8,
-8, 0, -8,
-8, 0, 8
};
double window[14][3] =
{
0, 0, 2,
-1.5, 0, 1.7,
-1.7, 0, 0.5,
-1.7, 0, -2.0,
1.7, 0, -2.0,
1.7, 0, 0.5,
1.5, 0, 1.7,
0, 0, 2,
-1.5, 0, 1.7,
-1.7, 0, 0.5,
-1.7, 0, -2.0,
1.7, 0, -2.0,
1.7, 0, 0.5,
1.5, 0, 1.7,
};
glBindTexture(GL_TEXTURE_2D, g_stoneTexture);
glPushMatrix();
glRotated(90,0.0,0.0,1.0);
gluTessProperty(tess, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_POSITIVE);
gluTessBeginPolygon(tess, NULL);
gluTessBeginContour(tess);
// glTexCoord2f(1.0, 1.0); Is this where I would put it?
gluTessVertex(tess, cubeside[0], cubeside[0]);
// glTexCoord2f(1.0, 0.0); Is this where I would put it?
gluTessVertex(tess, cubeside[1], cubeside[1]);
// glTexCoord2f(0.0, 0.0); Is this where I would put it?
gluTessVertex(tess, cubeside[2], cubeside[2]);
// glTexCoord2f(0.0, 1.0); Is this where I would put it?
gluTessVertex(tess, cubeside[3], cubeside[3]);
gluTessEndContour(tess);
gluTessBeginContour(tess);
gluTessVertex(tess, window[0], window[0]);
gluTessVertex(tess, window[1], window[1]);
gluTessVertex(tess, window[2], window[2]);
gluTessVertex(tess, window[3], window[3]);
gluTessVertex(tess, window[4], window[4]);
gluTessVertex(tess, window[5], window[5]);
gluTessVertex(tess, window[6], window[6]);
gluTessEndContour(tess);
gluTessEndPolygon(tess);
glPopMatrix();
Any advice on what I should do, would be greatly appreciated.