Here is a sketch of how one might go about doing skeletal animation in JavaScript, broken down into different npm modules that would need to be written:
- A BVH to JSON converter.
BVH is a standard format for representing skeletal animation, there is tons of data in the format, and many tools can consume/produce it. So getting things working in this space is priority #1. I think the best way to tackle this problem would be to write a simple module that takes a stream, and produce a JSON object that exactly represents the HIERARCHY and MOTION sections of a BVH file, along with some serialize method that can produce the same output. - A simple animation viewer. Outside voxel.js, we should probably have a stick figure animation viewer. this could be done in THREE.js using wires to draw each of the joints.
- A motion tweening module Or basically some method to interpolate between per-frame motions. This is necessary to perform basic animation playback
- Motion retargetting Need some library where you can give it a skeleton + motion data and a new skeleton along with some correspondence between the old skeleton and new skeleton; and produces a new set of motion data. This could be used to remove unnecessary bones from motion data, or to retarget human bvh data to voxel.js models.
- Voxel.js rendering Finally, the code needs to be integrated into voxel.js' character animation and rendering system
Above and beyond the above, there are other cool libraries/features that could be added on top of this:
- Inverse kinematics For adding some procedural animations/footskate clean up
- Motion graphs http://research.cs.wisc.edu/graphics/Gallery/kovar.vol/MoGraphs/ Useful for combining multiple BVH files together, creates seamless animations
- Advanced character controllers Can create sophisticated animations, like avoiding obstacles, catching things, interact with environment. Tons of literature, gets very deep: http://grail.cs.washington.edu/projects/graph-optimal-control/
- Advanced skinning To allow for non rigid/stick meshes to be drawn with animations (would require modifying THREE.js though)