Away3D in Flex 4 – Phase 3 – Importing MD2 Models

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.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值