Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

BvhImporterExporter (for Unity 3D)

Import/Export skeletons in Unity games during runtime using motion capture data saved in the Biovision Hierarchy format. · By Winterdust

Create new bvh

A topic by ay222cn created Aug 24, 2018 Views: 1,003 Replies: 3
Viewing posts 1 to 2

Hey,

Great tool and thanks for sharing the demo version!
I am trying to figure out, in which ways I can make a new bvh animation using your tool.
Specifically, I need to create a new bvh animation, using frames of other bvh animations.

Is there a documentation, that I could take a look on how to create a new bvh animation using your tool?
It would be great if you could explain to me the steps, on how to do that.

Thank you

Developer

Hi, glad you like it! The only documentation available are the descriptions for the methods. For creating brand new BVH animations it might be easiest to put them together using something like Blender, although it could be possible to puzzle it together in Unity as well through the methods. It's been a while since I experimented with the tool myself. Frames could also be copied manually between .bvh files by opening them in for example WordPad, if it's just a matter of combining some parts.

Hey,
I get the rotation of a joint, at a specific frame, using this line of code:
Vector3 rotation = bvh.allBones[bone_index].localFrameRotations[frame_index].eulerAngles;

I'm trying to compose a bvh file by writing rotations which I take from localFrameRotations[]
It seems that localFrameRotations[] has different values to the original file, and I can't understand the reason they differ. Is it because you retarget the bvh animation to a different skeleton or because you use different axes?

I am asking, because when I'm composing a bvh file using the localFrameRotations[], the rotations don't look ok at all.
How can I use localFrameRotations[] and make these rotations useful to me?

(I am aware of the structure of a bvh file and that a rotation is written in z,x,y format).

Thank you :)

Developer

It's been a few years since I wrote the code but localFrameRotations should be the rotation of the bone's beginning so that it points towards its end, in other words it's a look rotation. You could try setting localFrameRotations using Quaternion.LookRotation(<the bone's worldspace forward Vector3>, <the bone's worldspace up Vector3>);