Phase 3
Bringing in an MD2 model
Not the easiest process to find document on, but at least it is fairly simple once you get it. My main reference for this was this website. However, the information is from an older version of Away3D, and doesn't work right out of the box. So I picked out the parts that worked, and re-worked the Actionscript code to plop the MD2 model in place of the rotating box.
Notes about the code:
Note that the MD2 model is embedded. I am dynamically loading the image file, however, since it was easier to just replace the old texture with the new. Also, I have removed the animation, and left only a simple call to the first frame, since Away3D doesn’t seem to be loading fully until frame 1 – I will probably do more research on that in a little bit. I am using the free MD2 model from this website:http://telias.free.fr/models_md2_menu.html. I chose the horse model, and it imports without any issues. I don’t think it has any animation, though, which I will have to fix.
MD2 modeling/animation:
Though models are not impossible to find, MD2 has become fairly scarce. Most of the old sites have died, and none of the new sites are carrying much of interest. There are just plain better 3D game engines, better graphics formats, and different tools.
One great holdover is MilkShape, and this allows most 3D modelers to produce MD2 models. This site has a model loader/editor/saver, which imports a wide variety of formats and outputs an even wider variety. It has a free, time-limited demo, but the final product is only $35 (or 25 Euros), so it’s not a back-breaker. For my purposes, MilkShape’s main benefit is animating and exporting MD2; depending on how well it works, I will think about purchasing.
But don’t forget about Blender. Version 2.49 has a plugin that allows you to export MD2 (2.5 probably will, too, but that may be a year away yet). I have not tested it, and may not ever, since – for now – I am only doing a rudimentary test animation, and I don’t want to bother much with a complicated animation system that I don’t really understand yet. It behooves me to learn it, though, I know. . .
There is also this site, but it may be a bit outdated. Apparently you can set up MD2 animations directly in Away3D, too.