Help with texture rotation

Started by
1 comment, last by penetrator 19 years, 10 months ago
I''m trying to rotate a texture and apply it to an object. The code is the following: code: -------------------------------------------------------------------------------- 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 ); -------------------------------------------------------------------------------- Funny thing happens: ALL the textures rotate except the one that i want.
Advertisement
You could also try using glTexCoord3/4x. I believe it was x,y,rotate,scale.
I made some improvements but i really need some help. Here is the code:


code:
--------------------------------------------------------------------------------

glActiveTextureARB( GL_TEXTURE0_ARB );
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, textures[95].texID); // this is the first texture to rotate
glActiveTextureARB( GL_TEXTURE1_ARB );
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, heat_effect_textures[heat_texture_counter].texID); // this is the second one
cgGLBindProgram( g_CGprogram_vertex );
cgGLBindProgram( g_CGprogram_pixel );
cgGLEnableProfile( g_CGprofile_vertex );
cgGLEnableProfile( g_CGprofile_pixel );
cgGLEnableTextureParameter( g_CGparam_testTexture );
cgGLSetTextureParameter( g_CGparam_testTexture, VolumeTexture1 );
cgGLEnableTextureParameter( g_CGparam_testTexture2 );
cgGLSetTextureParameter( g_CGparam_testTexture2, BlurTexture);
cgGLEnableTextureParameter( g_CGparam_testTexture3 );
cgGLSetTextureParameter( g_CGparam_testTexture3, textures[30].texID);
glBegin(GL_TRIANGLE_STRIP);
glMultiTexCoord2fARB( GL_TEXTURE0_ARB,fTexMul4x * (x+ quad_ext)+x_tex,y_tex+ fTexMul4y * (y + quad_ext+quad_ext_sub)-.19);
glMultiTexCoord2fARB( GL_TEXTURE1_ARB,fTexMul4x * (x+ quad_ext)+x_tex,y_tex+ fTexMul4y * (y + quad_ext+quad_ext_sub)-.19);
glVertex2f(x, y+quad_ext_sub-82);
glMultiTexCoord2fARB( GL_TEXTURE0_ARB,fTexMul4x * (x+ quad_ext)+x_tex, y_tex+ fTexMul4y * (y+quad_ext)-.19);
glMultiTexCoord2fARB( GL_TEXTURE1_ARB,fTexMul4x * (x+ quad_ext)+x_tex, y_tex+ fTexMul4y * (y+quad_ext)-.19);
glVertex2f(x, y-82 );
glEnd();
glActiveTextureARB( GL_TEXTURE1_ARB );
glDisable(GL_TEXTURE_2D);
glActiveTextureARB( GL_TEXTURE0_ARB );
cgGLDisableTextureParameter( g_CGparam_testTexture );
cgGLDisableTextureParameter( g_CGparam_testTexture2 );
cgGLDisableTextureParameter( g_CGparam_testTexture3 );

--------------------------------------------------------------------------------

All the textures are correctly rendered, but the ones binded through the glActiveTextureARB call are not rotated.
The problem seems to occur when i enable the vertex and fragment programs with cgGLEnableProfile. Otherwise, if i disable the shader, the two textures are correctly rotated (but of course the shader is off) . I don''t know how to solve this, so any help is GREATLY appreciated.

This topic is closed to new replies.

Advertisement