- /
-
the rise of Matzilla!
on 19 Nov 2023
- 25
- 149
- 2
- 2
- 1094
drawframe(1);
Write your drawframe function below
%Hello all!!
%I started this code with one of my 2021 mini hack images:
%https://www.mathworks.com/matlabcentral/communitycontests/contests/4/entries/3626
%The result is just some layers of ocean made with two sines each, a good
%"capture" of them, and an emoji of our cute monster up and down.
%Aah, and some triangles to make him not so cute.
%First, we make layers of blue waves, then we make MATzilla and finally, we finish adding more waves.
function drawframe(f)
c=1200;
d=700;
n=800;
m=.37;
hold on;
%Let's make the ocean (1st part): we have some layers here [18-9] (behind Matzilla).
for i=18:-1:9
y=i/11*d;
a=10*m^(i-1);
u=c*(1-(i-1)/8);
x=linspace(0,c,n);
p=y/d*4*pi;
t=x*2*pi/u;
q=sin(f/4+.3*t)+sin(f/8+.2*t); %if you'll remix another ocean,
%you can change the frequency of them, or the amplitude... I used a frequency
%division whose result is an integer to make the waves move 1 period within 2
%seconds.
r=y+q*120*.8^(i-1);+3^(i-1);
v=[
x' r';
c 0;
0 0];
%making the ocean blue;
fill(v(:,1),v(:,2),i/18*[.1 .7 1],'EdgeColor','n');
end
%Now we can use emojis to make Matzilla: Dino + triangles.
%Move them with the variable "f" forward and backward.
if 24>=f
ht=text(380+f,670+f,'🦖','color','black','FontSize',60);
ht.Rotation = -55
it=text(850+f,609+f,'â–²','color','black','FontSize',20);
it.Rotation = -55
jt=text(975+f,579+f,'â–²','color','black','FontSize',30);
jt.Rotation = -65
kt=text(1040+f,525+f,'â–²','color','black','FontSize',30);
kt.Rotation = -65
else
ht=text(405+(25-f),695+(25-f),'🦖','color','black','FontSize',60);
ht.Rotation = -55
it=text(875+(25-f),634+(25-f),'â–²','color','black','FontSize',20);
it.Rotation = -55
jt=text(1000+(25-f),604+(25-f),'â–²','color','black','FontSize',30);
jt.Rotation = -65
kt=text(1065+(25-f),550+(25-f),'â–²','color','black','FontSize',30);
kt.Rotation = -65
end
%Ocean (2 part): we have more layers here [9-7] (in front of Matzilla).
for i=9:-1:7
y=i/11*d;
a=10*m^(i-1);
u=c*(1-(i-1)/8);
x=linspace(0,c,n);
p=y/d*4*pi;
t=x*2*pi/u;
q=sin(f/4+.3*t)+sin(f/8+.2*t);
r=y+q*120*.8^(i-1);+3^(i-1);
v=[
x' r';
c 0;
0 0];
fill(v(:,1),v(:,2),i/18*[.1 .7 1],'EdgeColor','n');
end
%final adjustments for plotting. Hope you like it. ;)
axis off;
ylim([250,n])
end
Animation
Remix Tree
-
-
-
- + 0 more
-
-