peaks(64);
oh=findobj(gca,'type','surface');
set(gca,'xlim',[-8 8]);
set(gca,'ylim',[-8 8]);
set(gca,'zlim',[-10 10]);
axis square;
for i = 1:36
rotate(oh,[0 0 1],10);
M(i) = getframe(gca);
end
movie(M,3)
load('vertex1');
set(gcf,'NumberTitle','off');
plot3(vertex1(:,1),vertex1(:,2),zeros(size(vertex1,1),1),'.');
view(2);
oh=findobj(gca,'type','line');
set(gca,'xlim',[-2 2]);
set(gca,'ylim',[-2 2]);
direction = [0 0 1];
rotate( oh, [0 0 1], -45);
inc = 0;
N = [];
for i = -45:3:45
inc = inc + 1;
rotate( oh, [0 0 1], 3);
f=getframe;
RGB = f.cdata;
I = rgb2gray(RGB);% RGB to gray
BW = imbinarize(I);% gray to binary
BWC = imcomplement(BW);
BWC2= imfill(BWC,'holes');
BWC3= flip(BWC2 ,2); %# horizontal flip
BAND = and(BWC2, BWC3);
BOR = or(BWC2, BWC3);
I = 255 * uint8(BOR); % binary to grayscale
match = size(find(BAND),1) / size(find(BOR),1);
N = [N match];
set(gcf, 'Name', num2str(match));
RGB = cat(3, I, I, I); % grayscale to RGB
%t = text(0,1.5,num2str(size(find(BAND),1) / size(find(BOR),1)));
f.cdata = RGB;
M(inc) = f;
end
for i = 1:size(M,2)
imshow(M(i).cdata);
set(gcf, 'Name', num2str(N(i)));
pause(0.1);
end