Jump to content
Posted 03 May 2011 - 11:26 AM
Posted 03 May 2011 - 11:30 AM
Posted 03 May 2011 - 11:48 AM
There are no opengl api functions related to loading models. Opengl simply accepts lists of triangles and lists of vertices. Transforming data formatted in certain filetypes to these lists is the responsibility of the user.
However even though it is not part of the OpenGL API, there are many libraries out there that will assist with loading one type or another, such as Assimp. Or you can write the interpreter yourself. OBJ is a common format to use for beginners as it is pretty simple. But basically you can use any format, but you must parse it into arrays of vertices for OpenGL to understand.
Posted 03 May 2011 - 12:33 PM
Posted 03 May 2011 - 12:35 PM
Edited by Monkan, 03 May 2011 - 12:36 PM.
Posted 04 May 2011 - 01:43 PM
When I first tried looking into ASSIMP I was pretty noobish and it was all a bit much for me to take in and took a while to get it working but then again it does take me a while to figure things out in general.
Anyway you might want to look into this:
Its called GLM and is used to load .obj models. I haven't had a chance to have a proper look yet but it looks pretty simple and a lot lighter than ASSIMP which does pretty much everything.
EDIT: Beat me to it.......
As for triangulated meshes, its pretty standard and can be done with the simple click of a button in most modelling programs e.g. Maya.It just means that the mesh consists only of triangles but it all depends what the model loader is set-up to work with. In that tutorial the model loader is only set up for triangulated meshes as it accepts 3 vertices for each face so if there are any faces with more than 3 vertices it will cause an error or draw weird.
Posted 20 May 2011 - 03:36 PM