Away3D Lite:ExMD2Cubic

加载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");
}

你可能感兴趣的:(away3d lite)