MATLAB | 官方举办的动图绘制大赛 | 第四周(收官周)赛情回顾

MATHWORKS官方举办的迷你黑客大赛第三期(MATLAB Flipbook Mini Hack)圆满结束,虽然我的水平和很多大佬还有比较大的差距,但所有奖也算是拿满了:

专家评选前三名,以及投票榜前十:~

每周的阶段性获奖者:


下面正式开始!

本次比赛要求提交名为drawframe(f)的函数代码,生成长达2s,48帧的动态图,动图生成是依靠如下代码来做到的:

function contestAnimator()animFilename = 'animation.gif'; % Output file namefirstFrame = true;framesPerSecond = 24;delayTime = 1/framesPerSecond;% Create the giffor frame = 1:48drawframe(frame)fig = gcf(); fig.Units = 'pixels';fig.Position(3:4) = [300,300];im = getframe(fig);[A,map] = rgb2ind(im.cdata,256);if firstFramefirstFrame = false;imwrite(A,map,animFilename, LoopCount=Inf, DelayTime=delayTime);elseimwrite(A,map,animFilename, WriteMode="append", DelayTime=delayTime);endend
end

闲话少叙,一起看作品!!


作品概览

Tim / Moonrun

https://ww2.mathworks.cn/matlabcentral/communitycontests/contests/6/entries/16134

function drawframe(f)if f == 1%% Make landscape
clf
rng(4,'v4');
N=200;
q=linspace(-1,1,N);
k=abs(ifft2(exp(6i*randn(N))./(q.^2+q'.^2+1e-9)));
k=rescale(1./(k+1));
imagesc(k);[x,y]=meshgrid(linspace(-1,1,N*7)*7);
k=repmat(k,[7,7]);
surf(x,y,k/2,'edgeC','none','SpecularS',0);
axis equal
colormap(copper)hold on;% Make moon
bscl = 1e5;rng defaultnl=1e4;
rd = rand(nl,1)/3+1;
po = randn(3,nl);
po = po./vecnorm(po);
[p,k,s]=SM(po',rd,7);ms = mean(s);
ns = s - ms;
s = erf(ns*500)/50+ms;[~,~,sb]=SM(po',randn(nl,1),1);% Now, take a page from Adam D.' book for the craters
rng(1,'twister');
x = randn(3,16);     % Let's add 16 craters
x = x./vecnorm(x);mfc = @(x,y,z)y.*(erf((x-z)*30)/2+.5);  % Using erf as the crater function...for n = 1:size(x, 2)d = vecnorm(x(:,n)-p');s = mfc(d',s-1.14,rand(1)/2)+1.14;
ends = s + sb/20;
s = (s-mean(s))/10+mean(s);
p2 = (p.'./vecnorm(p.'))'.*s;E='EdgeC';
F='FaceC';
O='none';
G='FaceA';% Plot moon
hold on;
bscl=1e1;
T2=trisurf(k,bscl*p2(:,1)+1*bscl,bscl*p2(:,2)+4*bscl,bscl*p2(:,3)+1*bscl,'FaceC','flat','FaceVertexCData',rescale(s,.4,1).*[1,1,1],E,O);       % Plot
material([0,1,0,10]);
axis equal off
set(gcf,'color','k');
light('position',[1,-1,1]); 
light('position',[1,-1,1]);camproj p
campos([0,-7.2,.35]);
camva(40);endx = linspace(0, 1, 49)*2;
dx=mean(diff(x));
x = 0:dx:200*dx;
y = cos(pi*x)/15;
a=linspace(0,2*pi,49)-2;
% for n = 1:1:48
n=f;cpos = [0.05, -7.2+2, .42] + [y(n), x(n), y(n)/2];camup([0, sin(a(n))/2, cos(a(n))/2+1]);campos(cpos);camtarget([0.05, -7.2+2, .42] + [y(n+1), x(n+1), y(n+1)/2]);1;endfunction [p,k,s]=SM(in,rd,r)
n=size(in,1);
k=convhull(in);                              % Points on "in" must lie on unit circle
c=@(x)sparse(k(:,x)*[1,1,1],k,1,n,n);        % Connectivity            
t=c(1)|c(2)|c(3);                            % Connectivity
f=spdiags(-sum(t,2)+1,0,t*1.)*r;             % Weighting
s=((speye(n)+f'*f)\rd);                      % Solve for s w/regularizer
p=in.*s;                                     % Apply
end

Tim / Planet and moon

https://ww2.mathworks.cn/matlabcentral/communitycontests/contests/6/entries/16129

function drawframe(f)% Procedural planet & moon
% Apologies for the sloppy code and a couple garbage variables. Based
% around Matlon5 code but forgot to add as a remix.persistent V
if f==1rng(5,'twister');
v=@vecnorm;
ra=@rand;
bscl = 1e5;% Usng a random sphere instead of fibonacci sphere like Matlon5
nl=1e5;
r=ra(nl,1)/3+1;
p=randn(3,nl);
p=p./v(p);
[p,k,s]=SM(p',r,5e1);% Spin points to make a gaseous looking surface...
p2 = (p.'./vecnorm(p.'))';
scl=-7;
p2(:,1:2) = [p2(:,1).*cos(p2(:,3)*scl)-p2(:,2).*sin(p2(:,3)*scl),p2(:,1).*sin(p2(:,3)*scl)+p2(:,2).*cos(p2(:,3)*scl)];% Re-smooth
[p3,k2,s2]=SM(p2,s,3e0);
p3 = (p3.'./vecnorm(p3.'))';% Add a storm in it
xp=[1,1,0.5]';
xp = xp/norm(xp);p2=p3';
for nn = 1:100
pob = p2./v(p2);
for n = 1:size(xp, 2)
if n == 1
xc = XP(xp(:,n),pob);
else
xc = xc + XP(xp(:, n),pob);
end
end
p2 = (p2./v(p2) + xc/1500).*s';
end
p3 = (p2./vecnorm(p2))';E='EdgeC';
F='FaceC';
O='none';
G='FaceA';% Plot planet
T=trisurf(k2,p3(:,1)*bscl,p3(:,2)*bscl,p3(:,3)*bscl,s2,E,O);       % Plot
material([0,1,0,10]);% Make it a purple planet
c1=[88,72,154];
c2=[112,89,145];
c3=[140,120,140];
c4=[180,160,170];
c5=[250,240,242];
c=[c1;c2;c3;c4;c5];cmp = interp1(1:5, c, linspace(1, 5, 256))/255;
colormap(min(cmp.^1.5*1.5,1));
cb = caxis;% % % Add a moon...
rng default
v=@vecnorm;nl=1e4;
rd = rand(nl,1)/3+1;
po = randn(3,nl);
po = po./vecnorm(po);
[p,k,s]=SM(po',rd,7);ms = mean(s);
ns = s - ms;
s = erf(ns*500)/50+ms;[~,~,sb]=SM(po',randn(nl,1),1);% Now, take a page from Adam D.' book for the craters
rng(1,'twister');
x = randn(3,16);     % Let's add 16 craters
x = x./vecnorm(x);mfc = @(x,y,z)y.*(erf((x-z)*30)/2+.5);  % Using erf as the crater function...for n = 1:size(x, 2)d = vecnorm(x(:,n)-p');s = mfc(d',s-1.14,rand(1)/2)+1.14;
ends = s + sb/20;
s = (s-mean(s))/10+mean(s);
p2 = (p.'./vecnorm(p.'))'.*s;E='EdgeC';
F='FaceC';
O='none';
G='FaceA';% Plot moon
hold on;
T2=trisurf(k,bscl*p2(:,1)/3+4*bscl,bscl*p2(:,2)/3-1*bscl,bscl*p2(:,3)/3,'FaceC','flat','FaceVertexCData',rescale(s,.4,1).*[1,1,1],E,O);       % Plot
material([0,1,0,10]);
axis equal off
set(gcf,'color','k');
light; 
light('color',[1,1,1]*.4);
caxis(cb);
V=hgtransform('Parent',gca);
set(T2,'parent',V);
camproj p;
camtarget([0,0,.2]*bscl);
end
a=-1.45:.018:-.59;
camva(9);
c=pi/4-sin(0:.131:2*pi)/10;
campos([sin(c(f)),cos(c(f)),0]*1.3e6);
set(V,'Matrix',makehgtform('zrotate',-a(f)));
endfunction cp=XP(n,p)n=n/vecnorm(n)*.9;
d=sqrt(sum((n - p).^2));
cp=cross(p, n.*ones(1,size(p,2)))./d.^2;endfunction [p,k,s]=SM(in,rd,r)
n=size(in,1);
k=convhull(in);                              % Points on "in" must lie on unit circle
c=@(x)sparse(k(:,x)*[1,1,1],k,1,n,n);        % Connectivity            
t=c(1)|c(2)|c(3);                            % Connectivity
f=spdiags(-sum(t,2)+1,0,t*1.)*r;             % Weighting
s=((speye(n)+f'*f)\rd);                      % Solve for s w/regularizer
p=in.*s;                                     % Apply
% S.D.G.
end

Adam Danz / A light in the attic

https://ww2.mathworks.cn/matlabcentral/communitycontests/contests/6/entries/16114

function drawframe(f)
persistent h x y n wdw
rng default
if isempty(h) || f==1% Dark skyaxes(Position=[0 0 1 1])s = 99;q=linspace(50,1,s);hold on % hold before imagesc to keep ydir normalimagesc(q'.*(q./q),[20,80])% Add star rotationtd=0:0.001:.1; % theta deltan=1000; % number of starstheta = pi/1.8*rand(1,n)+pi-.1;  % range: 180:270 +/- (quadrant III)[x,y]=pol2cart(theta+td',rand(1,n).*s*sqrt(2));x = x+s; % move polaris to the upper right cornery = y+s; % move polaris to the upper right cornerh = plot(x, y,'color','w');rgba = ones(n,4);rgba(:,4) = rescale(randg(1,n,1),.1,1);set(h,{'color'},mat2cell(rgba,ones(n,1),4))% Add grassy hillg = 1000; % number of grass bladesxg = linspace(0,s+1,g);yg = cos(xg/(s+1))*30+randg(1,1,g);area(xg,yg,FaceColor='k')xg=[1,1:.1:s,s];yg=[1,cos(0:.1/98:1)*30+randg(1,1,981),1];fill(xg,yg,'k')% Add house silhouettefill([4 4 3 6 9 8 8]*5,[5 7 7 8 7 7 5]*5,'k')% Add windowwdw=fill(30+2*[-1 1 1 -1],35+[2.2 2.2 .1 .1],[.1 .1 .1]);camva(6)axis equal offxlim([1 s])ylim([1 s])colormap gray
endk = round(f/48*height(x));
set(h,{'XData'},mat2cell(x(1:k,:),k,ones(1,n))',{'YData'},mat2cell(y(1:k,:),k,ones(1,n))')
if f==24wdw.FaceColor = [0.6 0.6 0.4];
end
end

Eric Ludlam / Will O’ Wisp

https://ww2.mathworks.cn/matlabcentral/communitycontests/contests/6/entries/15974

function drawframe(f)E=4; % Size of the forest environment% AbbreviationsJ=@rand;K=@rescale;VN=@vecnorm;persistent Lif f==1set(gcf,'color','k');% Select some nice tree locations%v1=[0 0 1.3%    1.4 0 1%    -1.3 0 1.2%    1 -1 1.3%    -1 -1 1.2%    -.5 -2.1 .9%    .34 -2 1%    .7 -2.3 .8%    -1.5 -4 1%    .6 1 1.2%    .4 2 1.3%    -.55 1.5 1.4];% Below is the compressed version of the above, saving almost 50 chars!v1=reshape(K('啥猸㦴檳䀘䪿岣摏㕱戭巫䦮啥啥啥䀘䀘⢩⫋⑧0檳耀留焗檳滵焗滵梑檳晰檳滵焗猸'-'0',-4,2),12,3);% Compressed version of color array: See parent of this remixB=(['ÆJJ';'ûÁ';'ŽF.';'¶eU';'›_ ';'¡g<';'¢aa';'·‰9'-' '])/256;G=([')™‰';'B¬B';'pé˜';'o™b';' ¡ ';'U~[';'JË«';'RîR']-' ')/256;for i=1:size(v1,1)%% Tree TrunksN=30;Q=.1;  % variation in distance from centerRN=12;  % n pts in bounding ringsrv=[.05 .02]; % Radius valuesrh=[0 1]; % Radius heights% Random pts on cylinderrt=linspace(0,2*pi,RN+1);rt(end)=[];T=[J(1,N)*pi*2 rt rt];h=[K(randn(1,N)) ones(1,RN)*rh(1) ones(1,RN)*rh(2)];% Adjust the radius based on heightR=interp1(rh,rv,h);pts=[cos(T).*Rsin(T).*Rh]';% triangulate the perfect cylindertf=convhulln(pts);% Push points in/out with variance of QD=(1-Q+J(1,size(pts,1))*(Q*2))';tv=pts.*(D.*[1 1 0]+[0 0 1]);        mkP(tf,(tv+v1(i,:).*[1 1 0]).*[1 1 v1(i,3)+.1],i,B,D);%% Tree topsN=150;% Alg for random distribution of pts on a sphere.T=J(1,N)*pi*2;u=J(1,N)*2-1;pts=[0 cos(T).*sqrt(1-u.^2)0 sin(T).*sqrt(1-u.^2)0 u ]';% triangulate the perfect spherelf=convhulln(pts);% Push points around to make foliage frumphyQ=.15;D=(1-Q+J(1,size(pts,1))*(Q*2))';lvr=pts.*D;% Scale down into our world and push up into treetopsss=v1(i,3)*.34;llv=lvr.*[.12+ss .12+ss .08+ss]+[0 0 .1];mkP(lf,llv+v1(i,:),i,G,D);%% Bumpy high-res groundN=400;Q=.2;% coordinatesT=J(1,N)*2;R=J(1,N)+.05;x=cospi(T).*R*E;y=sinpi(T).*R*E;% Triangulate the flat disc so we can draw itpv=[x' y'];pf=delaunay(pv);% VariationD=(J(1,size(pv,1))*Q)';% flip faces due to normals needing to match treesmkP(fliplr(pf),[pv D],4,G,D);end%% Our Wisp!L=line(1,1,1,'Marker','.','Markers',20,'Color','y');light('color','k'); % This light forces normals to be% computed on the patches but since it% is black, it has no visible effect.%% Decorate!set(gca,'position',[0 0 1 1],'vis','off','proj','p');axis([-E E -E E -1 E]);view(3);daspect([1 1 1]);campos([0 3 .5]);camva(60);camtarget([0 0 .7]);drawnow; % Force all vertex normals to be computedend%% Update Lightlp=[cospi(f/24)*.5 sinpi(f/24)*1.5-.5 cospi(f/12)*.2+.7];set(L,'XData',lp(1),'YData',lp(2),'ZData',lp(3));%% Apply lighting to all the patchesO=findobj('type','patch');for i=1:numel(O)doL(O(i));endfunction doL(p)% Perform a lighting operation on the object provided in p.% This algorithm is an adaption from the ML lighting% algorithm in webGL, but ignoring specular (to make it% spooky) and adding in distance based ambient lighting,% and adding range to the local light.cp=campos;v=p.Vertices;% Distance from camera, extending to range.gl_dist=K(min(VN(v-cp,2,2),max(E)),'InputMin',0,'InputMax',E*3);% Weight of ambient lighting.  Desaturate some of the red on tree in frontw_amb=[.3 .4 .4].*(1.1-gl_dist);% Effects of the wisps_diff=.7; % diffuse strengthlr=1.5; % max distance light can illuminated=v-lp;l_dist=min(VN(d,2,2),lr);s_dist=1-K(l_dist,'InputMax',lr,'InputMin',0);% Diffuse Weight% Invert vertex normals due to faces being in wrong order and - being shortw_diff=L.Color.*dot(-p.VertexNormals,d./VN(d,2,2),2)*s_diff;% CbaseColorFactor (ambiant and diffuse)bcf = min(max(w_diff,0), 1).*s_dist;% Accumulate all the terms and put on patch as colorset(p,'FaceVertexCData',min(p.UserData.*(w_amb+bcf), 1));end%% Shorten patch creationfunction mkP(f,v,i,C,D)% f - faces% v - vertices% i - thing index% C - Array of colors to pick from% D - distance array% Create our colors based on DbC=C(mod(i,size(C,1))+1,:);C2=hsv2rgb(rgb2hsv(bC).*[.1 1 .3]);q=bC-C2;fvc=K(D)*q+C2;% Create patch and stash colorspatch('Faces',f,'vertices',v,'EdgeC','n','FaceC','i',...'Amb',1,'FaceL','g','FaceVertexC',fvc,'U',fvc);endend

ME / View from a train window

https://ww2.mathworks.cn/matlabcentral/communitycontests/contests/6/entries/15834

function drawframe(f)
persistent Y
if(f==1)r = rand(1,4000);for i=1:5Y(i,1:800) = smoothdata(smoothdata(r(800*(i-1)+1:i*800)));end
end
clf
hold on
phi = linspace(0,1,4);
patch([1 30 30 1],[0 0 1.5 1.5],phi);
colormap(sky);
c = bone(8);
m = fliplr(1:5);
for i=5:-1:1area(Y(i,1+(m(i)-1)*f:30+(m(i)-1)*f)+(i/10),'FaceColor',c(i,:),'EdgeAlpha',0)
end
hold off
axis([1 30 0 1.5])
set(gca,'XTick',[],'YTick',[])
end

Tim / Snowfall

https://ww2.mathworks.cn/matlabcentral/communitycontests/contests/6/entries/15824

function drawframe(f)
clf% Face parameters for the mother (right) and child (left) that control
% things such as cheek shape, general head structure, eyes (open v. closed)HP=[2,4;.35,.45;8,4;.35,.3;.48,.52;1.28,1.32;2.3,2.2;1,-1;-.4,.3;.8,.75;4,20];% Mother's face
[x,y,z]=face(400,HP(:,2));% Rotation
a=@(x,y,r)x*cos(r)-y*sin(r);
b=@(x,y,r)x*sin(r)+y*cos(r);% Plot
r=.17;
S=@(x,y,z)surf(x,y,z,'EdgeC','none','FaceC',[1,1,1],'DiffuseS',.2,'SpecularE',1,'SpecularS',1,'AmbientS', 0.0);
S(a(x,y,r)-.2,z,b(x,y,r)-.1);
axis equal off
set(gcf,'color','k');% Light
light('pos',[-1.3,-1,.6]);
camzoom(2.8);
hold on;
% Child's face
[xa,ya,z2] = face(400,HP(:,1));
x2=a(xa,ya,.1);
r=.35;
S(-b(x2,z2,r)*.8-.8, a(x2,z2,r)*.8+.4, b(xa,ya,.1)*.8-.8);
camva(5)campos([-7,-15,3]);
camtarget([-.6,0,-.45]);rng default
N=99;
r=@rand;
a=r(N,1)*2*pi;
z=r(N,1);
a=a+(0:.25:2)*pi;
z=z.*ones(1,9);
d=r(N,1)*2+1;
d=d.*ones(1,9);
g=linspace(0,pi/4,49);
a=[a;a;a;a;a];
d=[d;d;d;d;d];
d=d(:);
z=[z;z-1;z+1;z-2;z+2];
c=a(:)+g(f);
scatter3(d.*cos(c)*2-.6,d.*sin(c)*2,z(:)-f/49,rescale(-d.*(cos(c)+sin(c)))*99+1,'w','filled','MarkerFaceA',.5);
plot3(0,1,-2,'k.','markers',1000)
endfunction [x,y,z]=face(n,P)% Start with a basic sphere
[x,y,z]=sphere(n);
% General distortions to make it more face like
z=erf(z*P(10));
x(y<0)= x(y<0)-abs(y(y<0)).^P(1)*P(2);
z(y<0)= z(y<0).*(1-.5*y(y<0).^P(3));
z(y>0)=z(y>0).*(1-.1*y(y>0).^2);
x(x<0)= erf(0.6*x(x<0))/0.6;
x(x>0)=x(x>0)*.9;
y(y>0)=y(y>0)*.9;
y=y+P(4);z(y>0)=z(y>0).*exp(-x(y>0).^2/3).^y(y>0);
y=y-.3;
x=x+.6;
x(x>0)=x(x>0)*.9;
x=x-.6;m=@(x,o,s).5-erf(-s*x+o).*erf(s*x+o)/2;
c=y(x<0);
c=1-exp(-(c+(exp(c*3)-0.4)).^2*3).*(.7*m(z(x<0),.8,10)+.3).*.1;
x(x<0)=c.*x(x<0);
fc=@(x)exp(-(-x+(exp(-x*9)-.6)).^2*2);
fc2=@(x)exp(-(-x+(exp(-x*2)-.6)).^2*2);% Adding nose & lips
x(x<0)=((1-1*m(z(x<0),2,15)).*(fc(y(x<0)*1+P(5))*.15)+1).*x(x<0);
x(x<0)=((1-1*m(z(x<0),.7,8)).*(fc(y(x<0)*2+P(6))*.08)+1).*x(x<0);
x(x<0)=((.7-.7*m(z(x<0),0,8.5)).*(-fc(-y(x<0)*P(7)-1.71)*.06)+1).*x(x<0);x=x+.5;
x(x>0)=x(x>0).*(1-.35*fc2((y(x>0)+.95)/1.4));
x=x-.5;z=z.*(((x-.2).^2+(y+.4).^2).^.4*.2+.8);
x=x+.5;% Adding eyes
[x,y,z]=ey(x,y,z,P,1);
[x,y,z]=ey(x,y,z,P,-1);
endfunction [x,y,z]=ey(x,y,z,P,s)
b=@(x)tanh(exp(-4*abs(x).^2.5));
xt=(z(x<0)+s*0.33)*5;
yt=(y(x<0)+.145)*7;
ofs=max(b2(yt+P(8)*.2*xt.^2,P(9),P(11)).*b(sqrt(xt.^2+yt.^2)), b(sqrt(1.5*xt.^2+yt.^2))*.7);
x(x<0)=x(x<0)-ofs/20;
end% Bump function with edge for eyes
function m=b2(x,of,s)
m=(erf((x+of)*s)/1.5+.5)+exp(-(x+(of-.1)).^2*10)/4;    
%S.D.G.
end

Nikolay Velkov / O Christmas Tree

https://ww2.mathworks.cn/matlabcentral/communitycontests/contests/6/entries/15939

function drawframe(f)% This is Xor's AMAZING shader% https://www.shadertoy.com/view/7lKSzw% Here is my translation to MATLABiRes = 300;iTime = f/48*2;persistent fragCoordif isempty(fragCoord)[x,y]=meshgrid(1:iRes, 1:iRes);fragCoord = cat(3,x,flip(y,1));endim = mainImage(fragCoord);im = imresize(im, [3*iRes, 3*iRes], 'method', 'bilinear');imshow(im);axis equalaxis off%% magicfunction finalColor = mainImage(fragCoord)finalColor = zeros(iRes, iRes, 3);r = cat(3,iRes,iRes);for i=0:400if mod(i,8) < 6even =  mod(i,2);c = [even,1- even,0];elsec = [1 1 1];endp = (fragCoord.* 2 - r)./r(:,:,2).*300 + cat(3,0,i-230)....+ cat(3,i+mod(i,99),i/4).*cos(iTime.*0.5+cat(3,i,i+11)).*0.5;for j = 1:3finalColor(:,:,j) = finalColor(:,:,j) + c(j)./vecnorm(p,2,3).^2;end endfinalColor = sqrt(finalColor./0.1);
end
end

HyunGwang Cho / Nyancat

https://ww2.mathworks.cn/matlabcentral/communitycontests/contests/6/entries/15839

function drawframe(f)
n=nan;% resample
f = mod(ceil((f)/2)-1,12)+1;% canvas
C=ones(69,124)*13;% rainbow
r=([1;1;1]*(7:12));
r=r(:);
r1=28:45;r2=r1-1;
if mod(f,4)<2r1=r2;r2=r1+1;
end
C(r1,[1:6,15:22,31:38,47:53])=repmat(r,[1,29]);
C(r2,[7:14,23:30,39:46])=repmat(r,[1,24]);% stars
a=[2,4,2,0,0,3];
a=mod(a+f-1,6);
y=[-1,8,20,42,54,64];
x=[61,3,21,30,9,55];
x=x-(f-1)*7;
for i=1:6C=p(C,x(i),y(i),s(a(i)));C=p(C,x(i)+84,y(i),s(a(i)));
end% tail (detail)
% z=nan(10,7);
% a=z;a(3:5,3:4)=1;a(5:6,5:7)=1;a([4,7],6:7)=0;a(3:4,[2,5])=0;
% a([22,25,32,36,46])=0;t{1}=a;t{5}=a;t{7}=a;t{11}=a;
% a(2,:)=n;a([4,5,15,26,56,65])=0;a([14,25])=1;t{4}=a;t{10}=a;
% a=z;a([12:11:67,13:11:46,31:11:64,41:11:63,11,21,66])=0;
% a([22:11:55,32:11:65])=1;t{6}=a;t{12}=a;
% a=z;a(7:8,3:6)=1;a(67)=1;a([6,9],4:6)=0;
% a([17,18,27,29,58,65,66,68])=0;t{2}=a;t{8}=a;
% a([17,59,56,66])=n;a([19,30,40,55])=0;a([29,39])=1;t{3}=a;t{9}=a;
% C=p(C,46,33,t{f});% tail (simple)
z=nan(10,7);
a=z;a(3:5,3:4)=1;a(5:6,5:7)=1;a([4,7],6:7)=0;a(3:4,[2,5])=0;
a([22,25,32,36,46])=0;t{1}=a;t{6}=a;t{7}=a;t{12}=a;
a(2,:)=n;a([4,5,15,26,56,65])=0;a([14,25])=1;t{2}=a;t{5}=a;t{8}=a;t{11}=a;
a=z;a(7:8,3:6)=1;a(67)=1;a([6,9],4:6)=0;
a([17,18,27,29,58,65,66,68])=0;t{3}=a;t{4}=a;t{9}=a;t{10}=a;
C=p(C,46,33,t{f});% foot
a=nan(3,6);a(:,2:5)=0;a(1:2,3:4)=1;a(6)=n;a(16)=0;
x=[6,7,6,4,4,6];x=[x,x]+50;x=x(f);
y=[3,4,4,4,4,3];y=[y,y]+40;y=y(f);
C=p(C,x,y,a);C=p(C,x+10,y,a);C=p(C,x+15,y,a);
a=zeros(5,4);a([1,2,6,20])=n;a(3:4,2:3)=1;a(18)=1;
C=p(C,x-4,y-2,a);% body
a=zeros(18,21);a([1,2,18,19])=n;a(2:17,2:20)=4;a([20,35])=0;
a(3:16,3:19)=5;a([39,40,51,52,57,70])=4;a(:,21:-1:18)=a(:,1:4);
b=[66,77,87,100,140,152];a([b,b+143])=6;
y=ones(1,12);y([1,6,7,12])=0;y=y+26;
C=p(C,53,y(f),a);% head
a=ones(13,16);a([1:5,11:14,25:26,39])=n;
a(1,5:9)=n;a(2,6:9)=n;a(3,7:9)=n;
a(6:9,1)=0;a(2:5,2)=0;a([10:14:52,40:14:82,27])=0;
a(13,5:9)=0;a(4,8:9)=0;a(:,16:-1:8)=a(:,1:9);
a(9:10,[3,4,14,15])=2;a(11,6:12)=0;a([75,114,153,125])=0;
a(7:8,[5,6,12,13])=0;a([59,150])=3;
x=[1,1,1,0,0,0];x=[x,x]+63;
y=[0,1,1,1,0,0];y=[y,y]+31;
C=p(C,x(f),y(f),a);% color map
m=[0,0,0;164,164,164;248,176,165;254,254,254;252,218,170;247,185,251;245,123,188;245,62,31;250,167,52;254,238,71;89,216,58;19,154,248;109,92,247;0,78,147]/255;% draw
imshow(uint8(C),m);
endfunction b=s(n)
x4=@(a) a([1:4,3:-1:1],[1:4,3:-1:1]);
z=nan(4);
a=z;a(16)=3;s{1}=x4(a);
a=z;a([12,15])=3;s{2}=x4(a);
a=z;a([8,12,14,15])=3;s{3}=x4(a);
a=z;a([4,8,13,14,16])=3;s{4}=x4(a);
a=z;a([4,6,13])=3;s{5}=x4(a);
a=z;a([4,13])=3;s{6}=x4(a);
b=s{n+1};
endfunction Y=p(I,x,y,S)
Y=padarray(I,[84,84]);
a=y+83+(1:size(S,1));
b=x+83+(1:size(S,2));
Y_=Y(a,b);
i=~isnan(S);
Y_(i)=S(i);
Y(a,b)=Y_;
Y=Y(85:153,85:208);
end

Daniel Pereira / Earth, our only home

https://ww2.mathworks.cn/matlabcentral/communitycontests/contests/6/entries/15769

function drawframe(f)persistent x;if f==1gx = geoaxes(gcf,'Position',[0 0 1 1],'Basemap','colorterrain','grid','off','tickdir','none');gx.Scalebar.Visible = "off";geolimits([-90 90],[-180 180]);x = getframe(gcf);x = x.cdata;endset(gcf,'color','k');rng(41);scatter3(2*rand(20,1)-1,2*rand(20,1)-1,-ones(20,1),'.w'); hold on;scatter3(2*rand(20,1)-1,ones(20,1),2*rand(20,1)-1,'.w');scatter3(ones(20,1),2*rand(20,1)-1,2*rand(20,1)-1,'.w');lt = linspace(-90,90,size(x,1));ln = linspace(-180,180,size(x,2));[LT,LN] = meshgrid(lt,ln+7.5*f);surf(cosd(LT').*cosd(LN'),cosd(LT').*sind(LN'),-sind(LT'),'cdata',(double(x)/255).^2,'edgecolor','none');axis equal off;hold off;% camlight(30,25);light('style','infinite','color',[0.95 1 0.9],'position',[cosd(180)*cosd(45) cosd(180)*sind(45) sind(180)]);material dull;
end

Nikolay Velkov / Collatz Tree

https://ww2.mathworks.cn/matlabcentral/communitycontests/contests/6/entries/15617

function drawframe(f)%% Draw the Collatz tree% initialize cycleG = graph([1 2],[2 4]);% starting numbern = 4; % depthdepth = round(f^(3/4)); % do recursionG = collatz(G,n,depth); % remove auto-added isolated nodesisolated_nodes = find(degree(G) == 0);G = rmnode(G,isolated_nodes);% create figurefig = figure;colormap coolp = plot(G);layout(p,'layered','direction','right')for j = 1:G.numedgesedge = table2array(G.Edges(j,:));labelnode(p,edge,string(edge));endp.NodeCData = cellfun(@str2double, p.NodeLabel);p.MarkerSize = 4;p.LineWidth = 1;p.NodeLabel = {};p.EdgeColor = 'w';cbar = colorbar;cbar.Color = 'w';cbar.FontSize = 12;axis offfig.Color = 'k';
end%% Collatz conjecture rule
function G = collatz(G,n,depth)if mod(n,3) == 2R = [2*n, (2*n-1)/3];elseR = 2*n;enddepth = depth -1;if ~depth return endfor j = 1:length(R)G = G.addedge(n,R(j));G = collatz(G,R(j),depth);end
end

O / Skywheel

https://ww2.mathworks.cn/matlabcentral/communitycontests/contests/6/entries/15367

function drawframe(f)persistent u w c gu g1 g2 c1 cd a0;
cp=@(a,c) colormap(a,c);if f==1rd=@(v) round(v);
sf=@(x,y,z) surface(x,y,z,EdgeColor='no');n=1e2;[x,y,z]=mkp(10,9.8,n);
z=.2*z-.1;[x1,y1,z1]=sphere(4);
x1=.1*rd(x1);
y1=.1*rd(y1);
z1=12*rd(z1);[z2,y2,x2]=mkp(1,.95,n);
z2=z2+12;
x2=.1*x2-.05;[z3,y3,x3]=mkp(.9,.01,n);
z3=z3+12;
x3=.9*x3-.45;a0=axes;
view(3);r0=30;
[x0,y0,z0]=sphere(n);
sf(r0*x0,r0*y0,r0*z0);hold on;c0=cp(a0,'abyss');
c0=flip(c0);
c0(:,1:2)=c0(:,1:2)/2;
c0(:,3)=c0(:,3)/1.4;c1=cp(a0,'sky');
cp(a0,c1);cd=(c0-c1)/48;rs=25;
ns=2e2;
ts=rand(ns, 1)*pi+pi;
ps=acos(rand(ns, 1));
xs=rs*sin(ps) .* cos(ts);
ys=rs*sin(ps) .* sin(ts);
zs=rs*cos(ps);rdsz=3*rand(ns, 1);
rdc=repmat((rand(ns, 1)+1)*.5, 1, 3);u=scatter3(xs,ys,zs,rdsz,rdc,'fi');gu=hgtransform(Pa=a0);
set(u,Pa=gu);campos([-10 -2 5]);
camtarget([0 -15 10]);
camva(49);axis equal off;a1=axes;
view(3);cm=cp(a1,'spring');
cm=cm/2;
cp(a1,cm);
material metal;light(Po=[-10 0 20],St='local');
light(Po=[-10 -30 5],St='local');
light(Po=[-20 -20 20],Col=[.7 .7 .5],St='local');axis equal off;s=[1 .8 .7];for i=1:3x=s(i)*x;y=s(i)*y;z=s(i)*z;w(i+12)=sf(z-.5,y,x);w(i+14)=sf(z+.5,y,x);
endt=pi/6;
rx=[1 0 0;0 cos(t) -sin(t);0 sin(t) cos(t)];for i=1:6[x1,y1,z1]=rot(x1,y1,z1,rx);w(i)=sf(x1-.5,y1,z1);w(i+6)=sf(x1+.5,y1,z1);
endfor i=1:12[x2,y2,z2]=rot(x2,y2,z2,rx);c(i,1)=sf(x2-.4,y2,z2);c(i,2)=sf(x2+.4,y2,z2); 
endfor i=1:12[x3,y3,z3]=rot(x3,y3,z3,rx);c(i,3)=sf(x3,y3,z3);
endalpha(c(:,3),0.2);g1=hgtransform(Pa=a1);
set(w,Pa=g1);g2=hgtransform(Pa=g1);
set(c,Pa=g2);campos([-10 -2 5]);
camtarget([0 -15 10]);
camva(49);endr=f*pi/6/48;
rx1=makehgtform(xrotate=r);
tl1=makehgtform(translate=[0 -sin(r) -cos(r)]);
set(g1,Ma=rx1);
set(g2,Ma=tl1);
rx2=makehgtform(yrotate=pi/9,zrotate=r/10);
set(gu,Mat=rx2);if f<=24c1=c1+cd;alpha(u,f/24)
elsec1=c1-cd;alpha(u,(48-f)/24)
end
cp(a0,c1);endfunction [x,y,z]=mkp(or,ir,n)x=zeros(5,n+1);y=x;z=x;[x([1 4],:),y([1 4],:),z([1 4],:)]=cylinder(ir,n);[x(2:3,:),y(2:3,:),z(2:3,:)]=cylinder(or,n);x(5,:)=x(1,:);y(5,:)=y(1,:);z(5,:)=z(1,:);
endfunction [x,y,z]=rot(x,y,z,t)r=@(v,s) reshape(v,s);s=size(x);p=[x(:) y(:) z(:)]';p=(t*p)';x=r(p(:,1),s);y=r(p(:,2),s);z=r(p(:,3),s);
end

Tim / Icy Comet

https://ww2.mathworks.cn/matlabcentral/communitycontests/contests/6/entries/15262

function drawframe(f)% Icy cometpersistent frms
if f == 1% A problem with texturing a sphere is what to do about the poles. It is difficult
% to texture the [x, y, z] surface matrices created using the
% sphere command without getting significant anisotropy, pinching and/or
% discontinuities near the top and bottom.
%
% In this example a randomly sampled sphere will be generated, then uniform noise will be added,
% followed by smoothing using the the connectivity matrix relating adjacent points. The
% smoothing allows the noise distribution to be made more realistic and
% avoids the pole pinching artifacts & discontinuities.% % % Creating the comet nodes% Random sphere used here: replace with a fibonacci sphere for a different
% effect% Predictable
rng(7,'twister');% Number of vertices on Asteroid
n=5e4;% Randomly sampled sphere
g=randn(3,n);
p=g./vecnorm(g);% % % Determining connectivity between points
k=convhull(p');
c=@(x)sparse(k(:,x)*[1,1,1],k,1,n,n);                   
t=c(1)|c(2)|c(3);% % % Create the roughness penalizer
w=spdiags(-sum(t,2)+1,0,t*1.);              % t*1. is to convert t from logical to double% % % Random radial distance function to be penalized:
r=rand(n,1);% % % Solve for smoothed surface. Smoothing will be different for ice vs.% rock components.
s=(speye(n)+1e3*w'*w)\r-.43;
s2=(speye(n)+3e3*w'*w)\r-.4;        % Smoother for the ice component
s=s/mean(s);
s2=s2/mean(s2);% % % Apply surface to vertices for rock & ice components
p1 = p.*s';
p2 = p.*s2';% % % Plot.
T(1)=trisurf(k,p2(1,:),p2(2,:),p2(3,:),'FaceC', 'w', 'EdgeC', 'none','AmbientS',0,'DiffuseS',1,'SpecularS',0);
hold on;
T(2)=trisurf(k,p1(1,:),p1(2,:),p1(3,:), s,'EdgeC', 'none','AmbientS',0);
colormap(flipud(gray));
caxis([-1,1]*std(s)+1);
T(1).Parent.Parent.Position(3:4) = [1120, 840];% % % For looping
H=hgtransform('Parent',gca);
H2=hgtransform('Parent',gca);
set(T,'parent',H);% Add stars in the background
rd = rand(n,1);
C=scatter3(p(1,:)*50, p(2,:)*50, p(3,:)*50, rd*300, [1,1,1].*rd,'.');
set(C,'parent',H2);% % % pretty
axis equal off                                          % Pretty
set(gcf,'color','k');
camproj p
camva(6);
camtarget([0,0,0.3]);
light('position',[2,-3,10],'style','local');
light('position',[2,-3,10],'style','local','color',[1,1,1]*.3);ags = linspace(0, pi/3, 48);
for n = 1:48set(H, 'Matrix', makehgtform('xrotate',n/(16*pi)));set(H2, 'Matrix', makehgtform('zrotate',n/(16*pi)));camtarget([0,0,0.3]);campos([21*sin(ags(n)), -21*cos(ags(n)), 0]);frms{n}=getframe(gcf);
endcnt = 1;
close
endimage(frms{f}.cdata);axis equal off
camva(4.5);% S.D.G.
end

Nikolay Velkov / Energy

https://ww2.mathworks.cn/matlabcentral/communitycontests/contests/6/entries/16004

function drawframe(f)% This is Xor's AMAZING shader% https://www.shadertoy.com/view/cltfRf% Here is my translation to MATLABiRes = [800 450];
iTime = f/16;
persistent fragCoord
if isempty(fragCoord)[x,y]=meshgrid(1:iRes(1),iRes(2):-1:1);fragCoord = cat(3,x',y');
end
im4 = mainImage(fragCoord);
imr = imresize(im4, flip(iRes).*2, 'method', 'bilinear');
im = imshow(imr);function finalColor=mainImage( fragCoord )
finalColor = zeros(iRes(1), iRes(2), 3);
r = cat(3,iRes(1),iRes(2));for i = 0:0.01:1% Center and scale outwardp = (fragCoord.* 2 - r)./iRes(2).*i;% Compute zz = max(1 - vecnorm(p,2,3).^2, 0);% Sphere distortion p = p./(0.2 + sqrt(z).*0.3);% Offset for hex patternp(:,:,1) = p(:,:,1)./0.9 + iTime;p(:,:,2) = p(:,:,2) + mod(ceil(p(:,:,1))*0.5, 1) + iTime * 0.1625;% Mirror quadrantsv = abs((mod(p, 1))-0.5);% Add colorc = [2, 3, 5]./2e3;d1 =max(v(:,:,1).*1.5+ v(:,:,1), v(:,:,1).*2);d2 =max(v(:,:,1).*1.5+ v(:,:,2), v(:,:,2).*2);d3 =cat(3,d1,d2);for j = 1:3finalColor(:,:,j) = finalColor(:,:,j) + c(j).*z./(abs(d3(:,:,2) - 1) + 0.1 - i * 0.09);end
end
finalColor = tanh(finalColor.^2);
finalColor = permute(finalColor,[2 1 3]);
end
end

Lateef Adewale Kareem / Six-Linked Bars Mechanism

https://ww2.mathworks.cn/matlabcentral/communitycontests/contests/6/entries/15492

function drawframe(f)persistent L1 L2 L3 L4 L5 L6 L7 L8 t2 t3 t4 t5 t6 ...Bar2 Bar3 Bar4 Bar5 Bar6 f1 f2 if f==1L1=5;L2=2;L3=6;L4=4;L5=6;L6=4;L7=5;L8=1;f1=@(t2,t)(L2*cos(t2)-(L1+L4*cos(t)))^2+(L2*sin(t2)-L4*sin(t))^2-L3^2;f2=@(x5,y5,T)[x5+L5*cos(T(1))-(L1+L7+0.9*L6*cos(T(2)))y5+L5*sin(T(1))-(L8+0.9*L6*sin(T(2)))];t=linspace(0,2*pi,7); brown=[206,179,140]/255;s=sin(t);c=cos(t);R=1.15;wclr=0.7*[1,1,1];hold on;fill(R*c,R*s,wclr); fill(L1+R*c,R*s,wclr); fill((L1+L7)+R*c,L8+R*s,wclr);xline(0);yline(0);axis equalt4=acos(((L2+L3)^2-L1^2-L4^2)/(2*L1*L4));c4=cos(t4);s4=sin(t4);t2=asin(sin(t4*L4/(L2+L3)));c2=cos(t2);s2=sin(t2);x3=L2*c2;y3=L2*s2;t3=atan2(L4*s4-L2*s2,L1+L4*c4-L2*c2);x5=L2*c2+(2/3)*((L1+L4*c4)-L2*c2);y5=L2*s2+(2/3)*(L4*s4-L2*s2);t56=fsolve(@(T)f2(x5,y5,T),[1.5*pi;1.5*pi]);t5=t56(1);t6=t56(2);Bar2=BarMaker(L2,'g',0); Bar2.Rotate(t2);Bar3=BarMaker(L3,'b',[0,0.45]); Bar3.Rotate(t3);Bar3.Trans([x3,y3]);Bar4=BarMaker(L4,'g',0);Bar4.Rotate(t4);Bar4.Trans([L1,0]);Bar5=BarMaker(L5,brown,0.3); Bar5.Rotate(t5);Bar5.Trans([x5,y5]);Bar6=BarMaker(L6,'r',0); Bar6.Rotate(t6);Bar6.Trans([L1+L7,L8]);axis([-2.6,11.4,-5,5])elset2=t2+2*pi/48; c2=cos(t2);s2=sin(t2);x3=L2*c2;y3=L2*s2;t4=fzero(@(t)f1(t2,t),t4); c4=cos(t4);s4=sin(t4);t3=atan2(L4*s4-L2*s2,L1+L4*c4-L2*c2);x5=L2*c2+(2/3)*((L1+L4*c4)-L2*c2);y5=L2*s2+(2/3)*(L4*s4-L2*s2);t56=fsolve(@(T)f2(x5,y5,T),[t5;t6]); t5=t56(1);t6=t56(2);Bar2.Rotate(t2);  Bar3.Rotate(t3);Bar3.Trans([x3,y3]); Bar4.Rotate(t4);Bar5.Rotate(t5); Bar5.Trans([x5,y5]); Bar6.Rotate(t6);end
endfunction B=BarMaker(L,clr,F)t1=pi/2+linspace(0,pi); t2=t1+pi; s1=sin(t1);s2=sin(t2);c1=cos(t1);c2=cos(t2);Xl=[0.5*c1,L+0.5*c2];Yl=[0.5*s1,0.5*s2];X=Xl; Y=Yl;Xl=[Xl,Xl(1)]; Yl=[Yl,Yl(1)]; for n=1:numel(F)f=F(n);X=[X,f*L,f*L+0.3*[c1,c2],f*L];Y=[Y,0.5,0.3*[s1,s2],0.5];Xl=[Xl,nan,f*L+0.3*[c1,c2]];Yl=[Yl,nan,0.3*[s1,s2]];endax=gca;H=hgtransform('Parent',ax);K=hgtransform('Parent',H);B.line=plot(Xl,Yl,'k','Parent',K);B.fill=fill(X,Y,clr,'EdgeColor','none','Parent',K);B.Rotate=@(t)set(K,'Matrix',makehgtform('zrotate',t));B.Trans=@(p)set(H,'Matrix',makehgtform('translate',[p,0]));
end

本次活动圆满结束,想参加只能等明年了,可以在比赛页面蹲一下:

  • https://ww2.mathworks.cn/matlabcentral/contests.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/263902.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

16ASM 分段和机器码

8086CPU存储分段管理 问题1&#xff1a;8086是16位cpu&#xff0c;最多可访问&#xff08;寻址&#xff09;多大内存&#xff1f; 运算器一次最多处理16位的数据。地址寄存器的最大宽度为16位。访问的最大内存为&#xff1a;216 64K 即 0000 - FFFF。 问题2&#xff1a;808…

解决方案:aarch64 ARM架构下安装Miniconda + 离线迁移Conda环境的全流程 踩坑避坑指南

目录 一、安装Miniconda1.1、确认本机架构1.2、下载Miniconda安装包1.3、安装Miniconda 二、离线配置Conda环境2.1、查看本机配置2.2、迁移虚拟环境2.3、可能遇见的报错 最后 在ARM架构下&#xff0c;由于Anaconda并不提供官方的ARM版本&#xff0c;在很多情况下强行在ARM系统中…

【图片版】计算机组成原理考前复习题【第2章 运算方法和运算器-2】

目录 前言 考前复习题&#xff08;必记&#xff09;​编辑 结尾 前言 在计算机组成原理的学习过程中&#xff0c;我们深入探索了计算机系统概述这一重要领域。计算机系统作为现代科技的核心&#xff0c;是整个计算机科学的基石。我们将学到的知识与理论转化为了能够解决现实…

为什么需要 Kubernetes,它能做什么?

传统部署时代&#xff1a; 早期&#xff0c;各个组织是在物理服务器上运行应用程序。 由于无法限制在物理服务器中运行的应用程序资源使用&#xff0c;因此会导致资源分配问题。 例如&#xff0c;如果在同一台物理服务器上运行多个应用程序&#xff0c; 则可能会出现一个应用程…

RabbitMQ学习笔记10 综合实战 实现新商家规定时间内上架商品检查

配置文件&#xff1a; 记住添加这个。 加上这段代码&#xff0c;可以自动创建队列和交换机以及绑定关系。 我们看到了我们创建的死信交换机和普通队列。 我们可以看到我们队列下面绑定的交换机。 我们创建一个controller包进行测试: 启动&#xff1a; 过一段时间会变成死信队列…

MySQL- in(集合) 和 not in(...) 的使用和练习

1. 基础用法 mysql中in常用于where表达式中&#xff0c;其作用是查询某个范围内的数据。 select * from where field in (value1,value2,value3,…) 当 IN 前面加上 NOT 运算符时&#xff0c;表示与 IN 相反的意思&#xff0c;即不在这些列表项内选择 select * from where …

API测试基础之http协议

http简介&#xff1a; http&#xff08;超文本传输协议&#xff09;是一个简单的请求-响应协议&#xff0c;它通常运行在TCP&#xff08;传输控制协议&#xff09;之上。它指定了客户端可能发送给服务器什么样的消息以及得到什么样的响应。请求和响应消息的头以ASCII码形式给出…

Star CCM+ 停止并保存用命令行运行的计算

在 StarCCM 命令行运行 中介绍了命令行运行计算的方法&#xff0c;有网友询问停止计算的命令&#xff0c;但计算一旦提交之后应该是不能用命令结束的&#xff0c;除非是用 kill 或任务管理器直接结束进程。然而&#xff0c;直接结束进程不会自动保存计算结果。 问题 通常情况下…

《使用ThinkPHP6开发项目》 - 创建应用

《使用ThinkPHP6开发项目》 - 安装ThinkPHP框架-CSDN博客 《使用ThinkPHP6开发项目》 - 设置项目环境变量-CSDN博客 《使用ThinkPHP6开发项目》 - 项目使用多应用开发-CSDN博客 根据前面的步骤&#xff0c;我们现在就可以开发我们的项目开发了&#xff0c;根据项目开发的需要…

轻量封装WebGPU渲染系统示例<46>- 材质组装管线(MaterialPipeline)灯光、阴影、雾以及多Pass(源码)

当前示例源码github地址: https://github.com/vilyLei/voxwebgpu/blob/feature/material/src/voxgpu/sample/MaterialPipelineMultiPasses.ts 当前示例运行效果: 此示例基于此渲染系统实现&#xff0c;当前示例TypeScript源码如下&#xff1a; export class MaterialPipelin…

[香橙派]Orange pi zero 3命令行配网方法——建立ssh连接——Ubuntu配置WIFI自动连接

一、前言 前面我们给Orange Pi安装了Ubuntu系统&#xff0c;并通过MobaXterm进行了串口连接&#xff0c;但其实并不方便&#xff0c;在日常开发中&#xff0c;我们希望能够使用更方便的ssh连接来进行操作&#xff0c;因此配置网络是必要的。 本章介绍的方法无需网线、HDMI线等&…

mapbox导入本地geojson数据并渲染

成果图 思路与源码 我这里使用的是ant的upload组件 <a-uploadv-model:file-list"fileList":showUploadListfalsename"file"action"https://www.mocky.io/v2/5cc8019d300000980a055e76":headers"headers"change"handleChange&…