加载MD2模型文件:
// 位图文件材质
var material:BitmapFileMaterial = new BitmapFileMaterial("assets/pg.png");
material.smooth = true;
// MD2文件类
var md2:MD2 = new MD2();
md2.material = material;
material.smooth = true;
md2.scaling = 10;
md2.centerMeshes = true;
var loader:Loader3D = new Loader3D();
loader.loadGeometry("assets/pg.md2", md2);
执行MD2模型动画:
private function onSuccess(event:Loader3DEvent):void
{
// MovieMesh: Animates a series of Frame objects in sequence in a mesh.
var model:MovieMesh = event.loader.handle as MovieMesh;
// Plays a pre-defined labelled sequence of animation frames.
model.play("walk");
}
加载与播放MD2模型
本文介绍如何使用AS3加载MD2模型文件并为其设置材质,同时演示了如何通过MovieMesh类来播放MD2模型的动画序列。
784

被折叠的 条评论
为什么被折叠?



