WhatMeWorry
2005.08.08, 09:18 PM
My textures are being horizontally flipped with the code below The Red book on p. 407 says"The texture coordinates of the texture square are (0,0), (1,0) (1,1) and (0,1) in
counter clockwise order. And my object vertices are in counter clockwise
order, right? I played around with clockwise ordering but that didn't seem to work.
Should both the texture and vertex coordinates go in the same CW or CCW order?
Is there some other setting that I'm missing?
glBegin(GL_QUADS);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0, 0.0);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 0.0)
glVertex3f(-xVertices, -yVertices, 0.0); // object vertex
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0, 0.0);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 100.0, 0.0);
glVertex3f( xVertices, -yVertices, 0.0); // object vertex
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0, 1.0);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 100.0, 100.0);
glVertex3f( xVertices, yVertices, 0.0); // object vertex
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0, 1.0);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 100.0);
glVertex3f(-xVertices, yVertices, 0.0); // object vertex
glEnd();
counter clockwise order. And my object vertices are in counter clockwise
order, right? I played around with clockwise ordering but that didn't seem to work.
Should both the texture and vertex coordinates go in the same CW or CCW order?
Is there some other setting that I'm missing?
glBegin(GL_QUADS);
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0, 0.0);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 0.0)
glVertex3f(-xVertices, -yVertices, 0.0); // object vertex
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0, 0.0);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 100.0, 0.0);
glVertex3f( xVertices, -yVertices, 0.0); // object vertex
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 1.0, 1.0);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 100.0, 100.0);
glVertex3f( xVertices, yVertices, 0.0); // object vertex
glMultiTexCoord2fARB(GL_TEXTURE0_ARB, 0.0, 1.0);
glMultiTexCoord2fARB(GL_TEXTURE1_ARB, 0.0, 100.0);
glVertex3f(-xVertices, yVertices, 0.0); // object vertex
glEnd();