-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvisualizeSkeleton.m
More file actions
37 lines (26 loc) · 981 Bytes
/
visualizeSkeleton.m
File metadata and controls
37 lines (26 loc) · 981 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function p = visualizeSkeleton(d, outfilename, startframe, endframe)
% Creates animation of mocap data and saves it to avi file
% based on mcanimate and mcplotframe from MotionCapture Toolbox
%
% comments
% Creates and returns an animpar structure by calling the function mcinitanimpar and
% setting the .limits field of the animpar structure automatically so that all the markers
% fit into all frames.
if nargin < 2
outfilename = 'flagtest.avi';
end
if nargin < 3
startframe = d.fFrame;
endframe = d.fFrame+d.nFrames-1;
end
% initialize animpar structure that determines how the visualization looks
p = mcinitanimparSkeleton;
% reorder data in c3d structure to have markers in the order expected
% for drawing the skeleton (which draws line segments between certain
% pairs of markers.
d.data = orderData(d)';
d.markerName = orderNames;
p.animate = 1;
p.output = outfilename;
p = mcplotframe(d,(startframe-d.fFrame+1):(endframe-d.fFrame+1),p);
return