2024 年 10 月 7 日 - 11 月 10 日,加入 MATLAB Shorts Mini Hack 大赛!
用 ≤2,000 个字符的 MATLAB 代码来创建 12s 短片,或者围观点赞现有作品,或者对现有作品进行再创作!
用有限的代码,释放你无的创造力!
先 / 睹 / 为 / 快
以下作品使用了 613 个字符的 MATLAB 代码完成。感兴趣的你也可以在自己的电脑上跑一下,执行有声哦:
作者注释:
Eric Ludlam: 音频是由我编写的振荡器生成的,该振荡器由这个 minihack 脚本控制,以确保它与视频同步。请参阅下面 pumpspring 的注释部分。
Pumpspring 是从去年比赛中我同名的 minihack 改编而来的,这样我就可以尝试生成声音。由于声音生成不是 minihack 的一部分,我可以将其注释掉以节省字符。
function drawframe(f)
persistent P Srf Zx
spring=sinpi(f/24)+2;
n=300;% Resolution of the sphere
S=10; % Number of spirals
w=.1/spring;% Thickness of the ribbon.
nb=12;% Number of bumps in the punkin
% Theta goes around S times, with n verts per round.
T=linspace(0,S*2,n*S);
T=[T;T];% top and bottom of ribbon
% Phi slowly goes from -.5 to .5 (top+bottom of sphere) with same # verts
% as theta.
P=linspace(-.5+w,.5,3000);
%P=-.5:.0003:.5;
P=[P;P-w];% top and bottom of ribbon, thickness of w.
% Radius of punkin has bumps. R modulates # of bumps.
R=1-(1-mod(T*nb,2)).^2/15;
% Make the surface coordinates
X=cospi(P).*cospi(T);
Y=cospi(P).*sinpi(T);
if f==1
Z=(.8+(0-(P*2).^4)*.2).*sinpi(P);
Zx=max(Z,[],'all');
% Draw
Srf=surf(R.*X,R.*Y,R.*Z,'FaceColor','#f71','EdgeColor','n');
surface(X/12,Y/12,Z/2+.7,'FaceColor','#080','EdgeColor','n');
camlight
lighting g
material([.6 .9 .3 2 .5])
daspect([1 1 1]);
axis([-1 1 -1 1 -3 .5],'off');
set(gca,'pos',[0 0 1 1],'clipping','off');
set(gcf,'color','w');
end
Z2=(.8+(0-(P*2).^4)*.2).*sinpi(P)*spring;
Z2x=max(Z2,[],'all');
set(Srf,'ZData',Z2-diff([Zx Z2x]));
%% Generate a tone:
% Tone is based on how sproinged the pumpkin is.
%springnorm = (spring-1)/2;
% AS is "audio syncrhonizer" object I wrote for this purpose.
%AS.osc.freq = 80-springnorm^4*20;
%AS.osc.volume = springnorm^5;
为什么要参与?
创意表达:用 MATLAB 将你的想法以短片方式呈现出来
小白友好:没有经验也没关系,欢迎所有人参与
社区互动:为你喜欢的作品投票,或对现有作品进行再创作
赢取大奖:还可能收获令人兴奋的奖励(奖金、礼品卡、纪念衫等)!
如何参与?
使用 MATLAB 代码创造你的 12s 精彩短片
本次竞赛持续 5 周:2024 年 10 月 7 日 00:00 - 11 月 10 日 23:59(美东时间)
提交作品参与比赛,或参与互动,为你喜欢的任意多的作品投票等
从社区中汲取创作灵感,加入你自己的创意,对现有作品进行再创作,使其成为你的作品
全部0条评论
快来发表一下你的评论吧 !