I'm trying to write skeleton data into BVH file, for that I need to get the total number of frames and write it before the joints data as the hierarchy of the bvh file is. The function SensorSkeletonFrameReady
allows me to have the frame number but I'm using this function to extract the joints data of each frame and write it directly into bvh file.
Can anyone help me, please?
BVH files have the total number of frames represented in the file. It is impossible to know this number until you are done recording.
Using the SkeletonFrameReady
event you could:
List
(or some other array type structure) List
items) ... or ...
... or ...
I'm not really taking that last one too seriously. But it all comes down to the fact that you don't know the number of frames until you are done! You have to complete your recording first, before you output that line in the file.
Unless you recording really long sessions, storing your data in a List
and then writing the data file once you've stopped is the most straight forward means. In my opinion.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.