- /
-
Logo
on 29 Nov 2023
- 30
- 36
- 1
- 1
- 1022
drawframe(1);
Write your drawframe function below
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