senem
09-23-2007, 01:24 PM
I completed to load a .tga file in cpp&opengl. The fallowing code is successful.
...
glRasterPos2i(0,0);
glDrawPixels..
..
And I tried same .tga file to do texture mapping on the following codes,(I used same loader code) it didn't run :
I try to solve problem.
1-) Pixel number is more than the object size. Is it a problem?
2-) There isn't a load error on program, but object is not covered with .tga. What can be the problem?
glBegin(GL_TRIANGLE_STRIP);
glTexCoord2f(2.0, 0.0); glVertex3f(2.0, -2.0, -2.0);
glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -2.0, -2.0);
glTexCoord2f(2.0, 2.0); glVertex3f(2.0, -2.0, 2.0);
glTexCoord2f(0.0, 2.0); glVertex3f(-2.0, -2.0, 2.0);
glEnd();
...
glRasterPos2i(0,0);
glDrawPixels..
..
And I tried same .tga file to do texture mapping on the following codes,(I used same loader code) it didn't run :
I try to solve problem.
1-) Pixel number is more than the object size. Is it a problem?
2-) There isn't a load error on program, but object is not covered with .tga. What can be the problem?
glBegin(GL_TRIANGLE_STRIP);
glTexCoord2f(2.0, 0.0); glVertex3f(2.0, -2.0, -2.0);
glTexCoord2f(0.0, 0.0); glVertex3f(-2.0, -2.0, -2.0);
glTexCoord2f(2.0, 2.0); glVertex3f(2.0, -2.0, 2.0);
glTexCoord2f(0.0, 2.0); glVertex3f(-2.0, -2.0, 2.0);
glEnd();