I was wondering howto rotate my texture around its center and not the lower left corner that it does now with this code:
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glRotatef(x, 0.0f, 0.0f, 1.0f);
glMatrixMode(GL_MODELVIEW);
I was wondering howto rotate my texture around its center and not the lower left corner that it does now with this code:
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glRotatef(x, 0.0f, 0.0f, 1.0f);
glMatrixMode(GL_MODELVIEW);
This should make the texture rotate around (0.5, 0.5):
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glTranslate(0.5, 0.5, 0.5); // z is not really relevant
glRotatef(x, 0.0f, 0.0f, 1.0f);
glTranslate(-0.5, -0.5, -0.5);
glMatrixMode(GL_MODELVIEW);