I have been trying to render 3d models with OpenGL ES 2.0 using this library here.
I tried to render this model using it's .obj
file and everything seems to work fine without textures and rendered successfully. Although I can't find a way to make textures work even the library supports it and have textured 3d models placed in the demo.
What I figured out during my research is that there are mainly three files.
- .obj file (wavefront file responsible for information about the geometry of 3D objects).
- .mtl file (materials file responsible for describing how the app should apply textures to that model).
- .png/.jpg files (images files responsible for texturing the 3d model).
I tried to load the .obj
file successfully then applied the textures with .png
file and had no luck, even tried to load .obj
and .png
side by side but still not working.
Another issue is that most of the 3d models have multiple texture files in .png
or .jpg
format and I don't how to work with that because demo 3d models in the library only have a single texture file.
There is a 3d model like this which contains a collada file with .dae
extention and textures are baked into that file along with the geometry and textures work perfectly fine with this one. We need either .obj
or .dae
to get information about the geometry and never both. That's what I figured out so far.