How to load md2 file with OpenGL(GLUT)

1.3k views Asked by At

I have created a solid sphere with texture and without animation in Blender.I have exported it in md2 file format.Now I want to load it with OpenGL using c++.Iam new in programming,I have learned about md2 file formate but can't write code to load it so please provide me code or any site link where I will get code. Thanks you

1

There are 1 answers

0
datenwolf On BEST ANSWER

OpenGL is "merely" a drawing API (though a powerfull one). It doesn't deal with loading files, be it geometry or images, managing scenes or other high level stuff. That's all your responsibility.

You can not load MD2 files using OpenGL, but you can of course load MD2 files using a MD2 file loader/parser and feed the extracted data to OpenGL. That's a big difference. If those concepts are very new to you I suggest you first start with getting the grips on OpenGL itself by following some tutorials: http://www.opengl.org/wiki/Getting_started#Tutorials_and_How_To_Guides

Once you're firm with OpenGL itself you may either write your own MD2 parser, or use some third party library for doing so. But don't get ahead of yourself, save yourself that frustration.