Hello,
I am experiencing troubles when I try to change your 3D models by mine.
This is the way, I am doing it:
1) I create models or import models with 3DS Max then after modifying them and texturing them, I export them to .obj and generate a texture file.
2)If necessary, I reduce the number of polygons to be able to work in real time.
3) I use the famous obj2opengl.pl script to generate a .h file to embed it in the example. (I have several arrays: vertex, faces, normals and textures coordinates)
glBindTexture(GL_TEXTURE_2D, thisTexture->mTextureID); glVertexPointer(3, GL_FLOAT, 0, myTeapotVerts); glNormalPointer(GL_FLOAT, 0, myTeapotNormals); glTexCoordPointer(2, GL_FLOAT, 0, myTeapotTexCoords); // draw data glDrawArrays(GL_TRIANGLES, 0, myTeapotNumVerts);
until then it's working fine the problem is the texture aren't mapped as they should.
I don't understand where the problem is coming from.
I don't know if it's from the code, from 3DS Max(texture coordinates) or...
I have attached some files so you can see what's happening
It would be a great help if someone could give me a hint
I already thank you for the information you might provide me
Allan
Hi, AlessandroB
Thanks for help..
But still not able to render texture properly.. :(
I have banana.h and banana.jpg texture. I have test my application using these files. It render correctly.
I have notice that banana.jpg file doesn't contain in transperant background. But in my texture TextureTeapot3.png (Flip vertically) 512x512 size contain lots of blank spaces. So how to overcome this problem..
I know this is related with image tool. Give me some links if have have related to it. Because I stuck here more than 12 days.