Capítulo 187 de 859

Chapter 187: MD2Loader

Core Idea

A loader for the MD2 format.

The loader represents the animations of the MD2 asset as an array of animation clips and stores them in the animations property of the geometry.

Code Examples

const loader = new MD2Loader();
const geometry = await loader.loadAsync( './models/md2/ogro/ogro.md2' );
const animations = geometry.animations;
  • What it demonstrates: Typical usage of MD2Loader.

Reference Tables

Constructor

Signature
new MD2Loader( manager : LoadingManager )

Methods

MethodDescription
.load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback )Starts loading from the given URL and passes the loaded MD2 asset to the onLoad() callback.
.parse( buffer : ArrayBuffer ) : BufferGeometryParses the given MD2 data and returns a geometry.

Key Takeaways

  1. MD2Loader extends: Loader
  2. Key methods: load, parse.

Connects To