-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathlogo.m
More file actions
66 lines (62 loc) · 2.05 KB
/
Copy pathlogo.m
File metadata and controls
66 lines (62 loc) · 2.05 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
animateFrames()
function animateFrames()
animFilename = 'logo.gif'; % Output file name
firstFrame = true;
framesPerSecond = 24;
delayTime = 1/framesPerSecond;
% Create the gif
for frame = 1:48
drawframe(frame);
fig = gcf();
fig.Units = 'pixels';
fig.Position(3:4) = [300,300];
im = getframe(fig);
[A,map] = rgb2ind(im.cdata,256);
if firstFrame
firstFrame = false;
imwrite(A,map,animFilename, LoopCount=Inf, DelayTime=delayTime);
else
imwrite(A,map,animFilename, WriteMode="append", DelayTime=delayTime);
end
end
end
function drawframe(f)
cla
axis off
mu = sqrt([9.6397238445, 15.19725192, 2*pi^2, ...
29.5214811, 31.9126360, 41.4745099]);
L{1} = 30*membrane(1,25);
L{2} = 2*membrane(2,25);
L{3} = -2*membrane(3,25);
L{4} = 5*membrane(4,25);
L{5} = -3*membrane(5,25);
L{6} = 4*membrane(6,25);
t = .04*(f-1);
Z = cos(mu(1)*t)*L{1} + sin(mu(2)*t)*L{2} + sin(mu(3)*t)*L{3} + ...
sin(mu(4)*t)*L{4} + sin(mu(5)*t)*L{5} + sin(mu(6)*t)*L{6};
axes('CameraPosition', [-193.4013 -265.1546 220.4819],...
'CameraTarget',[26 26 10], ...
'CameraUpVector',[0 0 1], ...
'CameraViewAngle',9.5, ...
'DataAspectRatio', [1 1 .9],...
'Visible','off', ...
'XLim',[1 51], ...
'YLim',[1 51], ...
'ZLim',[-13 40]);
surface(Z, ...
'EdgeColor','none', ...
'FaceColor',[0.9 0.2 0.2], ...
'FaceLighting','phong', ...
'AmbientStrength',0.3, ...
'DiffuseStrength',0.6, ...
'Clipping','off',...
'BackFaceLighting','lit', ...
'SpecularStrength',1.0, ...
'SpecularColorReflectance',1, ...
'SpecularExponent',7);
light('Position',[40 100 20], ...
'Style','local', ...
'Color',[0 0.8 0.8]);
light('Position',[.5 -1 .4], ...
'Color',[0.8 0.8 0]);
end