![]() ![]() Yes but what the hell is a frame? A frame is like a picture in a movie. We won't use these variables because the md2 model's texture is stored in another file, most of the time a PCX or a TGA file, and we obtain the texture's dimensions from these files.įramesize specifies the size in bytes of each frame. Then we've got the dimensions of the texture (respectively the width and the height). The next variable indicates the file version and must be equal to 8. If it isn't equal to “IPD2” then you can close the file and stop the loading. When loading the file in memory, check this value and be sure it's equal to “IPD2”. Ok I'll explain briefly all these variables.įirst you have what is called a “magic number”. Int ofs_glcmds // offset to opengl commands Int ofs_st // offset to s-t texture coordinates Int ofs_skins // offset to skin names (64 bytes each) Int num_glcmds // number of opengl commands Int num_st // number of texture coordinates Int framesize // size of one frame in bytes Here is the MD2 header structure definition (called md2_t): // md2 header ![]() Ok let's start with some theory about the MD2 file format! So what? here is a little overview of what we'll see in this article:Īlso, the source code is totaly free and downloadable at the end of this document.īefore starting I would like to say that I am assuming that you're familiar with the C++ and the OpenGL API. First because the MD2 file format is a good 3D model file format for learning because of it simplicity (if you're a beginner, you may not understand this, but look at other model file formats and you'll see -)) and then, because this format is absolutely free!!! (but not models, be careful!). You probably think “Damn, this guy stucks in the 1997 ol' days” but there are good reasons to use it. “Yeah a new MD2 tutorial yet.” Yes but mine will show you how to render them by a different way -) But what the heck is an MD2 anyway? the MD2 file format is a 3D model file format used in Id Software's Quake II engine! And here I'll show you how to load and display it to the screen using OpenGL!
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |