Advertisement Jump to content
Sign in to follow this  
nitegame

Textures

This topic is 3941 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

Hi all, I have a problem I can not get around. I am trying to use textures. Something like: glPushMatrix(); IQ3D::setColor( 0.6, 0.4, 0.1, 1.0); IQ3D::setShininess( 90.0); IQ3D::setSpecular( 0.2, 0.2, 0.2,1.0); int texID1 = _texManager.loadTexture("media/metal036.bmp"); IQ3D::bindTexture(texID1, 0); glTranslatef(2.5,1.5,0.5); glRotatef(45,0,0,1); //IQ3D::drawCube(0.5, 0.5, 0.5); //glutSolidTeapot(0.5); glutSolidCube(0.5); glPopMatrix(); When I render this. The texture only works if I use the teapot but not with any other object. Any idea why this could be? (note: the IQ3D functions work well and they only are alias with some parameters). Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Hi,

glutSolidTeapot automatically generates texture coordinates, but glutSolidCube doesn't.

-juuso

Share this post


Link to post
Share on other sites
Note: you seem to be loading textures every time you render your scene. That's a bad habit to get into. Load them once before using them, and unload them once when you don't need them anymore.

Share this post


Link to post
Share on other sites
Quote:
Original post by Captain P
Note: you seem to be loading textures every time you render your scene. That's a bad habit to get into. Load them once before using them, and unload them once when you don't need them anymore.



You are right. Thanks a lot for the note! I was wondering why it was so slooooow :S

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!