MD2 (Quake II Style) 3D Model Animator for C#/XNA
Matthew Lynch has released a sample that uses animated MD2 (Quake 2) models in XNA.
Hi all,
Over the last few nights I have been writing a MD2 model loader/animator for C# and XNA.
It is stable now and supports all the fundemental features of MD2 (with the exception of OpenGL commands). Using the class you can load a MD2 model from file, texture the model and animate the model in a controlled fashion.
I intend to make further improvements in the next few days/weeks, but it is more than usable; I have also made a demonstration application to show how to use it.
The class is fairly well documented, but one of my primary goals is to improve the documentation. The demo project is not so well documented, but is fairly straight foward. Documenting and improving the demo project is also one of my goals.
I have been programming for over a decade, but I am new to C# and XNA and may have made rookie mistakes. I encourage constructive criticism. Drop me a line at lynch82@gmail.com if you see anything that needs improvement.
I am in the process of setting up a source forge page for the project, but in the mean time you can get it from the following locations.
Demonstration/Tutorial Application:
http://www.matthewlynch.net/dev/xnamd2/releases/20070426-xnamd2-test-src.rarBase Source Code:
http://www.matthewlynch.net/dev/xnamd2/releases/20070426-xnamd2-base-src.rarThe project was finalised using the Microsoft XNA Game Studio Express 1.0 Refresh release; however most of the work was done using the Microsoft XNA Game Studio Express 1.0 release so it should be compatible.
I also believe it should be easily ported to C# and the XNA framework without the need for the actual Game Studio; but I don’t know enough about this to be sure.
The code is released under the Creative Commons Attribution-SharAlike 3.0 license, details of which can be found here:
http://creativecommons.org/licenses/by-sa/3.0/
Short Term To Do List:
* Allow animations to be called by name. Currently animations can only be controlled by defining the start and end frames for the animation you wish to play.
* Better code documentation, and a tutorial.
* Improve the demonstration project.Known Issues:
* I tested the class with 26 models from various locations on the web. All bar 2 worked fine. The two that failed were from a common source (the jHexen project) and loaded but were fairly distorted. These models crashed MilkShape3D (a MD2 compatible model editor) but worked fine in Blender (another MD2 compatible editor). Needs to be looked into.
The original article can be found here.

No comments
Jump to comment form | comments rss [?] | trackback uri [?]