Parses BioVision Hierarchy (BVH) motion capture files into a JavaScript friendly object representation.
More info on BVH:
const fs = require('fs')
const parseBVH = require('parse-bvh')
console.log(parseBVH(fs.readFileSync('example.bvh').toString()))
npm install bvh-parser
require('parse-bvh')(bvhString)
Takes a BVH file as a string as input
bvhString
is the contents of a BVH fileReturns An object representing the data contained in the BVH file. It has the following properties:
joints
an array of all the joints in the file, sorted by order of occurrence in the biovision file. Each joint has the following properties:
name
the name of the jointindex
index of the joint in the joints
arrayoffset
a 3D vector offset of the jointchannels
the parameters describing the jointchannelOffset
start of the channel offset in the jointparent
reference to parent jointchildren
an array of all child joints for a given jointframeTime
the number of seconds/frame in an animationframes
an array of frames. each frame is a flat array of all channel data for each joint(c) 2018 Mikola Lysenko. MIT License