Skip to main content
GameDev.net gamedev.net
🔒 Locked

Game Tutorial #4 Texture Problem

Started by Feblex Mar 22, 2003 at 4:14 AM 0 replies 500+ views
Original Post
Feblex
Feblex
Greetings, I''m having an exceptionally bad time geting texture loading to work with Game Tutorial #4. I know the texture loading worka, as I tried the code previously, but I can''t for the life of me get textures to load on my own models. I see the model, but it''s grey. The texture is 512*512, a BMP, and GL_TEXTURE_2D is enabled. What could I be doing wrong? In GameInit: TankSkin.LoadBMP("Models/tank1/camo.bmp", GL_LINEAR, GL_LINEAR); Tank.Load("Models/tank1/tank.md2"); In GameMain: glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //Clear screen and depth buffer glLoadIdentity(); //Reset the current modelview matrix glTranslatef(0.0f, 0.0f, -15.0f); glColor4f(0.5f, 0.5f, 0.5f, 1.0f); glScalef(0.2f, 0.2f, 0.2f); glEnable(GL_TEXTURE_2D); glPolygonMode(GL_FRONT, GL_FILL); glPolygonMode(GL_BACK, GL_FILL); glBindTexture(GL_TEXTURE_2D, TankSkin.ID); hobgoblin.Animate(Tank.stateStart, Tank.stateEnd, 0.05f);
Marty666
Marty666
Are u sure the texture is still bound when rendering the model? Sure all the tex coordinates are right? Sure you bound the right texture?
I''ve had this problem. It turned out to be a stupid mistake by me. I used an array to store all the ID''s and used the array index instead of the value Just debug and watch all the relevant values.
Handle all the exeptions: Is the filename right? Is the file opened? Is the data loaded? Is the texture bound? Is the ID stored correctly? etc.
Can''t help you out more untill I see some of the texture loading/rendering code.

Marty
_ /__ /|| | || MtY | ||_____|/Marty

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.