Quantcast
Viewing all articles
Browse latest Browse all 5

Rajawali Tutorial 15: MD2 Animation

Here’s a new feature that has been requested frequently: MD2 Animation.

MD2 animations were originally used in Quake 2 and contain keyframe per-vertex animations. 3D programs like Blender are able to export to this format.

The Rajawali Examples app has been updated so check it out if you want to see it in action.

MD2 files can be imported like this:

MD2Parser parser = new MD2Parser(mContext.getResources(), mTextureManager, R.raw.ogro);
parser.parse();

VertexAnimationObject3D myMD2Object = (VertexAnimationObject3D)parser.getParsedAnimationObject();
myMD2Object.setLight(mLight);
addChild(myMD2Object);

Playback can be triggered by using any of the following functions:

// -- play all frames
myMD2Object.play();
// -- play a specific animation, don't loop:
myMD2Object.play("crawl", false);
// -- play a specific animation, loop:
myMD2Object.play("crawl", true);

Check out the full example on Github:

On to Rajawali Tutorial 16: Collision Detection


Viewing all articles
Browse latest Browse all 5

Trending Articles