Jump to content
  • Advertisement
Sign in to follow this  

Texture matrix

This topic is 4958 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i'm trying to work a bit with texture matrix and i've got a small problem. I've this function that renders a sphere with a texture:
void DrawSphere(CVector3 Pos,float speed)
{
    glBindTexture(GL_TEXTURE_2D, g_textureId);
    glEnable(GL_TEXTURE_2D);

    glMatrixMode(GL_TEXTURE);
    glLoadIdentity();
    glTranslatef(0.0f, Spin, 0.0f);
    Spin += speed;
    glMatrixMode(GL_MODELVIEW);
	
   
    glInterleavedArrays( GL_T2F_N3F_V3F, 0, g_sphereVertArray );

    glTranslatef( Pos.x, Pos.y, Pos.z );
    glDrawArrays( GL_QUAD_STRIP, 0, g_nTotalVerts );

    glDisable(GL_TEXTURE_2D);
}

and works fine. the problem is that if i render another textured object, its texture changes too, and i don't want that. How can i do?

Share this post


Link to post
Share on other sites
Advertisement
glMatrixMode(GL_TEXTURE);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);

added at the end of the function. feel so stupid.thanks :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!