mm2 = mm_m;
mmt = mm_m;
%mmt(:,6) = mmt(:,6) - 90;

%mm2(:,4) = -mmt(:,4) - 90;

%mm2(:,5) = mmt(:,5) + 90;
%mm2(:,6) = mmt(:,6) - 90;
joints = (size(mm2,2)-3)/3;
for i=2:joints
   xinx = (i-1)*3 + 4;
   yinx = (i-1)*3 + 5;
   zinx = (i-1)*3 + 6;
   
   mm2(:,xinx) = mm2(:,xinx);
   
   mm2(:,yinx) = mmt(:,zinx);
   mm2(:,zinx) = -mmt(:,yinx); 
   
   %mm2(:,zinx) = mm2(:,xinx);
   %mm2(:,xinx) = mmt(:,yinx);%mm2(:,zinx);
   
end

%mm2(:,1:3) = 0;


skel_m = skel_m2;

%9:16 - 17:24
% for i=9:16
%  skel_m.tree(i).rotInd = skel_m2.tree(i+8).rotInd;
%  skel_m.tree(i+8).rotInd = skel_m2.tree(i).rotInd;
% end


% pp = mm2;
% 
% mm2(:,25:42) = pp(:,43:60);
% mm2(:,43:60) = pp(:,25:42);
% 
% %61:72  - 73:84
% mm2(:,61:72) = pp(:,73:84);
% mm2(:,73:84) = pp(:,61:72);

for j=1:size(skel_m.tree,2)
   o_offset =  skel_m.tree(j).offset;
   %skel_m.tree(j).offset = 0;
   %skel_m.tree(j).offset(1) = skel_m.tree(j).offset(3);
   %skel_m.tree(j).offset(3) = skel_m.tree(j).offset(1);
   
   %skel_m.tree(j).offset(1) = o_offset(1);
   skel_m.tree(j).offset(2) = o_offset(3);
   skel_m.tree(j).offset(3) = -o_offset(2);
   

end

%    skel_m.tree(15).offset = skel_m2.tree(15).offset;
%    skel_m.tree(15).offset(1) = skel_m2.tree(15).offset(3);
%    skel_m.tree(15).offset(3) = skel_m2.tree(15).offset(1);
%    
%    skel_m.tree(23).offset = skel_m2.tree(23).offset;
%    skel_m.tree(23).offset(1) = skel_m2.tree(23).offset(3);
%    skel_m.tree(23).offset(3) = -skel_m2.tree(23).offset(1);


mm3 = mm_m;
mm3(:,1:3) = 0;

figure(10);
subplot(1,2,1);expVisualise(mm2(1,:),skel_m);
subplot(1,2,2);skelVisualise(mm3(1,:),skel_m2);%view(70);