1.2.1 • Published 2 years ago

bvh-builder v1.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

BVH Builder

Description

This is a NPM module to build BVH (BioVision Hierarchy). This module convert JSON to BVH format.

Basic usage

// ES6
import getBVHBuilder from "bvh-builder";

// CommonJS
const getBVHBuilder = require("bvh-builder").default;


const builder = getBVHBuilder();

builder
    .header()
    .setHierarchy({
        type: "root",
        name: "Hip",
        offset: { x: 0, y: 0, z: 0 },
        channels: ["Xposition", "Yposition", "Zposition", "Zrotation", "Xrotation", "Yrotation"],
        children: [
            {
                type: "joint",
                name: "Leg",
                offset: { x: 1, y: 2, z: -1 },
                channels: ["Zrotation", "Xrotation", "Yrotation"],
                children: [
                    {
                        type: "end-site",
                        offset: { x: 0, y: 5, z: 0 },
                    }
                ],
            },
        ],
    });

builder.motion()
    .init(0.013)
    .addFrame({
        values: [0, 1, -2, 0, 1, -2, 0, 0, 0],
    });

const output = builder.build();
1.2.1

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago