
fm = [1 2 6 5; 2 3 7 6; 3 4 8 7; 4 1 5 8; 1 2 3 4; 5 6 7 8]

vm = [0 0 0; 1 0 0; 1 1 0; 0 1 0; 0 0 1; 1 0 1; 1 1 1; 0 1 1]


figure;
hold on;
k = 4;
K = [-k,k];
xlim(K); ylim(K); zlim(K)

patch('Vertices',vm,'Faces',fm, 'FaceVertexCData',hsv(6),'FaceColor','flat'); view(-37.5, 30)


Z = vm';

%OrthoProjXY = [1 0 0; 0 1 0; 0 0 0];
%Shear3 = [1 2 0; 0 1 0; 0 0 1];
%Z = Shear3*Z;
%patch('Vertices',Y','Faces',fm, 'FaceVertexCData',hsv(6),'FaceColor','flat'); view(-37.5, 30)
%Z = [X Y];

%%Shear3*Z = [1 0 0;  0 0 0; 0 1 0];

%%Y = Shear3*Y;
%%fill3(Y(1,:),Y(2,:),Y(3,:),'g');
%%Z = [Z Y];

MyRotation3{1} =  @(t) [1 0 0; 0 cos(t) -sin(t); 0 sin(t) cos(t)];
MyRotation3{2} =  @(t) [cos(t) 0 -sin(t); 0 1 0; sin(t) 0 cos(t)];
MyRotation3{3} =  @(t) [cos(t) -sin(t) 0; sin(t)  cos(t) 0; 0 0 1];
%

for j = 1:3
for t = [0:pi/8:2*pi];
pause;

Y = MyRotation3{j}(t)* Z;
L = size(Y,2);
patch('Vertices',Y','Faces',fm, 'FaceVertexCData',hsv(6),'FaceColor','flat'); view(-37.5, 30)
end
end





