Loading meshes using Assimp in OpenGL

I have been catching up on OpenGL 4.4 lately and realized that there are few working examples on the newer versions of OpenGL. The following code uses Assimp, GLFW and GLEW to load and render all supported Assimp formats and requires OpenGL 3.0 or above.

Comments

Truncator

Skirrah

Very helpful code but perhaps someone could help me resolve an error when using with assimp-3.1.-win-binaries.
Code compiles but gives runtime error; “The program can’t start because assimp.exe is missing from your computer.”
The assimp.dll file is in the same folder as the program executable.

Greetings Skirrah. What version of Assimp are you using? As I have understood, there is a problem with the 3.1(.1) version of the Windows binaries. Until the issue is fixed, I would recommend that you downgrade your version of Assimp. The bug has been reported to the Github repo, you can keep up with the status of it here: https://github.com/assimp/assimp/issues/302

Mike Hou

Hi, I learned assimp importing from this tutorial, thank you.
I think the code
glVertexAttribPointer(3, 3, GL_FLOAT, GL_FALSE, 0, NULL);
glEnableVertexAttribArray (3);
should be removed since they are not used, am I correct?