Tag Archive for md2

Quake II的MD2文件格式(译)

The Quake II’s MD2 file format
Quake II
MD2文件格式(译)

normal;">written by David Henry, december 21st of 2002

(本文由头发抽筋翻译,转载请保留原作者的版权信息,这片文章跟译者博客的另一篇讲md2文件格式的文章是同一个作者在不同时间写的,这一篇较为全面,容易理解。原文地址http://tfc.duke.free.fr/old/models/md2.htm, 译文地址:http://codeand.me/a/quake-ii_md2_format_chinese/

none black 0cm; padding: 0cm 0cm 0cm 0cm;">

Introduction
介绍

“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!
“耶!一个新的MD2教程 我会展示给你如何用另外的方法渲染MD2模型;-) 那么MD2到底是什么呢?MD2文件是Id Software Quake II 引擎中使用的3D模型的格式。这里我将会用OpenGL展示给你如何载入和显示MD2文件!

You probably think “Damn, this guy stucks in the 1997 ol’ days” but there are good reasons to use it. 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!).
你可能会想“靠,这个东西(MD2文件)早在1997年就有的了”但是我给你几个使用它的理由。首先,因为MD2文件格式是一种方便学习的3D模型文件格式,因为它很简洁(如果你是一个菜鸟,你可能不会理解我说的,但是你只要去看看别的模型格式你就知道错了;-)),再者,这种格式是完全免费的!!!(小心!!别人制作好的模型并不全是免费的!)

So what? here is a little overview of what we’ll see in this article:
怎么样?这里是全篇文章的简短的概述:

·The MD2 File Format
MD2
文件格式

·Developping a CMD2MODEL class
开发一个CMD2MODEL

·Reading and storing a MD2 model
读取和存储MD2模型

·Displaying it to the screen
显示模型到屏幕

·Animation
动画

Also, the source code is totaly free and downloadable at the end of this document.
当然在文章结尾处的源码是完全免费的。

Before starting I would like to say that I am assuming that you’re familiar with the C++ and the OpenGL API. Ok let’s start with some theory about the MD2 file format!
在开始之前我假定你熟悉C++OpenGL API。OK,让我们开始MD2文件格式的一些理论学习! Read more

MD2文件格式(quake2的模型)

 

MD2 file format

(Quake 2′s models)

Written by David Henry, 19th December of 2004

(本文由头发抽筋翻译,转载请保留原作者的链接版权信息和本文的连接)

http://tfc.duke.free.fr/coding/md2-specs-en.html 原文地址

http://codeand.me/archives/133 本文地址

Introduction
介绍

The MD2 model file format was introduced by id Software when releasing Quake 2 in November 1997. It’s a file format quite simple to use and understand. MD2 models’ characteristics are these:

MD2模型文件格式是在id software 199711月发布Quake 2时推广出来的。它一个使用简单和易于理解的文件格式。MD2模型的特征包括如下这些:

· Model’s geometric data (triangles);

模型的几何数据(三角形带);

· Frame-by-frame animations;

逐帧的动画;

· Structured data for drawing the model using GL_TRIANGLE_FAN and GL_TRIANGLE_STRIP primitives (called “OpenGL commands”).

为绘制模型组织的数据是用GL_TRIANGLE_FAN GL_TRIANGLE_STRIP图元组成的。

Model’s texture is in a separate file. One MD2 model can have only one texture at the same time.

模型的纹理是隔离出来的,不包含在MD2文件内部。一个MD2模型在同一个时刻只能有一种纹理。

MD2 model file’s extension is md2. A MD2 file is a binary file divided in two part: the header dans the data. The header contains all information needed to use and manipulate the data.

MD2模型文件的扩展名是“.md2″. 一个MD2文件是一个二进制文件,它分成两个部分:头部(the header)和 数据(data)部分。头部(the header)包含了全部需要使用和操作的数据。

Read more