Reputation:
I am new to opengl, and I followed some tutorial on the internet. I Can load 3D models, and display them with a 2D texture wrapped on them... I would like to be able to create a 3D textured model in blender, and export it to my opengl program, so I would have the exact same model with the same 3D texture on it. I know It has something to do with uvs, and texture models but I cannot find out what.... Can anyone help me, suggest a tutorial, or make a special texture loader for me (in C++ if possible )? PS: again, I now how to load 2D textures, and wrap them on a 3D model, but that Is not what I want!
Upvotes: 0
Views: 2798
Reputation: 173
I prefer the .obj format to import models from blender. You need to write some kind of obj Loader. There are tons of tutorials on how to accomplish that. But in a nutshell you need to load the positions, indices, normals, etc. From an .obj file.
I would just watch this whole series. (Or for your needs the last video)
https://m.youtube.com/playlist?list=PLEETnX-uPtBXT9T-hD0Bj31DSnwio-ywh
In the last video he also shows how to use an .obj Loader. And also a texture loader is provided in this tutorial.
If you want to export the texture specified in blender theres a line in the .obj file which contains the path to the texture. So you could load from that.
Upvotes: 1