MasDennis/Rajawali — pull request #331 by CZdravko (2013-01-22 08:07:36+00:00)
Title: MD5 GPU vertex skinning

A new material that can perform shader vertex skinning:

attribute vec4 vBoneIndex1;
attribute vec4 vBoneWeight1;

void main() {
mat4 TransformedMatrix = (vBoneWeight1.x * uBoneMatrix[int(vBoneIndex1.x)])
+(vBoneWeight1.y * uBoneMatrix[int(vBoneIndex1.y)])
+(vBoneWeight1.z * uBoneMatrix[int(vBoneIndex1.z)])
+(vBoneWeight1.w * uBoneMatrix[int(vBoneIndex1.w)]);
......
}

Example :
In Renderer initScene:

MD5AnimParser md5animparser = new MD5AnimParser("animation_name", this, animation_resource_id);
md5animparser.parse();

BoneAnimationSequence md5anim = (BoneAnimationSequence) md5animparser.getParsedAnimationSequence();

meshparser = new MD5MeshParser(this, mesh_resource_id);
meshparser.parse();

md5mesh = (AnimationSkeleton) meshparser.getParsedAnimationObject();
md5mesh.setAnimationSequence(md5anim);

DiffuseMaterial material = new DiffuseMaterial(true);
md5mesh.setMaterial(material);

md5mesh.addLight(mLight);
addChild(md5mesh);

In onSurfaceCreated:

md5mesh.play