Advertisement

Rotate a texture with glTexCoord

Started by December 23, 2001 05:31 PM
0 comments, last by Daywalker313 23 years, 2 months ago
I want to rotate a texture centered and only with glTexCoord. I''ve tried it with glMatrixMode(GL_TEXTURE), but if i''m rotating ( glRotatef(degrees,0,0,1) ), the texture isnt centered and its affecting my lightmap, ''cause I''m using multitexturing. Anybody knows how I''d have to change my TexCoords to create a rotation?
I don''t know how to explain that in English, so I will try in German

Ich hatte so ein Problem auch vor kurzem.
Du musst dazu 3 Matrizen nehmen (Rotation um x, y und z Achse)
und diese dann Multiplizieren. Die Matrizen enthalten jede Menge cos und sin Funktionen, die du brauchst.
Auf www.stefanzerbst.de gibts ein Tutorial dadrüber. Das ist zwar auf DirectX aufgebaut, aber es ist ziemlich einfach das in OpenGL zu übernehmen. Wenn ich den Source Code von meinem Projekt finde, dann kann ich dir den auch schicken...

Bis dann, MrK...

This topic is closed to new replies.

Advertisement