Easiest to load with OpenGL blender export format [closed]
-
10-10-2019 - |
Question
I'm developing an OpenGL ES 2.0 application with C++.
I want to show my blender's models using OpenGL but I don't know which is the easiest format to load with OpenGL ES 2.0.
I've been trying with Wavefront obj format how to unpacked vertices and how to obtain vertices for glDrawElements' last parameter.
Doy you know an easiest format?
Thanks.
Solution
OBJ is a pretty easy format. You can see the spec at http://www.martinreddy.net/gfx/3d/OBJ.spec
You do the loading yourself, of course. You read the .obj file and create the vertices yourself. Faces are like vertex indices.
Be careful, though: OpenGL ES 2.0 cannot render polygons other than triangles, so your obj files must not contain any other polygons or you must convert those yourself.
OTHER TIPS
I just tried a couple of formats. It looks like the PLY format ( you might have to enable that export format in the user preferences ) exports the model with only one index array. So you don't need multiple index arrays like with the Wavefront OBJ format. Which is very difficult with OpenGL. See rendering-meshes-with-multiple-indices