-
Notifications
You must be signed in to change notification settings - Fork 1
Bvh loader
Nikola edited this page Jun 15, 2022
·
1 revision
- Objective 1 [DONE] bvh.py to bvh.js β
https://www.npmjs.com/package/bvh-loader
- Objective 2 [DONE] Implement loader/draws intro matrix-engine. Make pseudo (primitives) Skeletal Mesh and adapt it to the bvh loader output data.π€
βββ javascript-bvh/ [Vanila JS] | βββ bvh-loader.js | βββ example.bvh | βββ index.html [test page] βββ module/ [module JS - npm] | βββ bvh-loader.js βββ index.js βββ test.js [test module] βββ module.html [test module] βββ package.json βββ LINCENCE βββ README.md
Navigate to module.html it is local test for npm package.
This link also use npm service via cdn.skypack.dev
https://codepen.io/zlatnaspirala/pen/vYdVxQR
Use great cdn.skypack.dev free service. No build , free hosting library.
Just put in test.js import MEBvh from "https://cdn.skypack.dev/bvh-loader@0.0.3"
;
import MEBvh from "https://cdn.skypack.dev/bvh-loader@0.0.9";
var anim = new MEBvh();
anim.parse_file("https://raw.githubusercontent.com/zlatnaspirala/Matrix-Engine-BVH-test/main/javascript-bvh/example.bvh").then(() => {
console.info("plot_hierarchy no function")
anim.plot_hierarchy();
var r = anim.frame_pose(0);
console.log("FINAL P => ", r[0].length)
console.log("FINAL R => ", r[1].length)
var KEYS = anim.joint_names();
for(var x = 0;x < r[0].length;x++) {
console.log("->" + KEYS[x] + "-> position: " + r[0][x] + " rotation: " + r[1][x]);
}
var all = anim.all_frame_poses();
console.log("Final All -> ", all);
});
Local test
import MEBvh from "./index";
var anim = new MEBvh();
anim.parse_file("https://raw.githubusercontent.com/zlatnaspirala/Matrix-Engine-BVH-test/main/javascript-bvh/example.bvh").then(() => {
console.info("plot_hierarchy no function")
anim.plot_hierarchy();
var r = anim.frame_pose(0);
console.log("FINAL P => ", r[0].length)
console.log("FINAL R => ", r[1].length)
var KEYS = anim.joint_names();
for(var x = 0;x < r[0].length;x++) {
console.log("->" + KEYS[x] + "-> position: " + r[0][x] + " rotation: " + r[1][x]);
}
var all = anim.all_frame_poses();
console.log("Final All -> ", all);
});
GNU GENERAL PUBLIC LICENSE Version 3
Original source: https://github.com/dabeschte/npybvh
