PDA

View Full Version : Help with texture rotations



Alessandro_dup1
05-30-2004, 01:10 PM
Hi, i'm trying to rotate a texture and apply it to an object. The code is:



glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glRotatef(rot,0, 0, 1);
glMatrixMode(GL_MODELVIEW);
Draw_Object();Funny thing happens: ALL the textures rotate except the one that i want :confused:

yooyo
05-30-2004, 01:32 PM
Have you set glActiveTexture()?

yooyo

Alessandro_dup1
05-30-2004, 01:37 PM
Hi, what i'm doing is:

cgGLEnableTextureParameter( g_CGparam_steam_animation );
cgGLSetTextureParameter( g_CGparam_steam_animation, heat_effect_textures.texID);

glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glRotatef(rot,0, 0, 1);
glMatrixMode(GL_MODELVIEW);

Draw_Object();
cgGLDisableTextureParameter( g_CGparam_steam_animation );

plasmonster
05-30-2004, 07:13 PM
Which texture unit are you using? You may recall that you only have a texture matrix stack for the implementation defined MAX_TEXTURE_UNITS. I've been bamboozled by this one before.

Alessandro_dup1
05-30-2004, 08:34 PM
What do you mean ? :confused:

plasmonster
05-30-2004, 11:39 PM
I mean that each texture unit has its own matrix stack, and the total number of texture units is implementation defined. You can use glGet*() with MAX_TEXTURE_UNITS to get the number. You can read about this in chapter 2 of the spec, if you're interested.

Alessandro_dup1
05-31-2004, 01:26 AM
Number returned is 8. So that means i can use up to 8 texture with multitexture extension ? Or else ?