• Remix
  • Share
  • New Entry

on 21 Oct 2022
  • 6
  • 21
  • 0
  • 0
  • 269
% Blue Morning glory
m=0:.01:1;
[R,T]=ndgrid(m,0:.01:2);
% Compute the disk with the petals built-in
X=R.*cospi(T);
Y=R.*sinpi(T);
% Convert Z to have an S curve to it to make it fluted
Z=(1-cospi(R*1.1)).^.2;
% Plot the stamen as little things in the middle
plot3(m*0,m*0,m/4+.6,'oy',LineW=2);
% Compute a petals curve to support the color
% In this flower, it is round, and colors only show the petal structure.
% Also use the colormap to make the shape apparent b/c we don't have room
% left to turn on lights.
M=1-mod(T*5,2);
C=-sinpi(R-.05).*(1-(M.^2-.5).^2);
% Draw flower body
surface(X,Y,Z,C);
shading interp
axis equal off
% Re-use m from above
m(2,:)=m;
m(3,:)=.9;
colormap(m');
set(gcf,Color='#2a2')
view([-34 40]);
Remix Tree