• Remix
  • Share
  • New Entry

on 28 Oct 2022
  • 7
  • 65
  • 0
  • 1
  • 279
% Scheherazade : A green speckled breed of pumpkin
% Or maybe a tall acorn squash?
% This particular breed is tall and stays green with a hint of yellow
% inside the ridges.
[X,Y,Z]=sphere(200);
R=1-(1-mod(0:.1:20,2)).^2*.06;
x=R.*X;
y=R.*Y;
z=R.*Z;
c=hypot(hypot(x,y),z);
% Several pumpkin breeds with speckles have a different color in
% the dents than on the ridges. To start off, set the CData of the
% surface to be == distance from center iff the pumpkin were round.
% Thus, c is for round (inclusive of ridges) and we squish it into
% a pumpkin shape below in the Z component of the surf call.
% To add speckles, add scaled random noise which will only be
% visible near the boundary of the two colors.
surf(x,y,(.8-(1:-.01:-1)'.^4*.1).*z*1.5,c+randn(201)*.027)
shading interp
% Stem, recycling the sphere coords from above.
surface(X/12,Y/12,Z+.4,c-.12,FaceC='#652',EdgeC='n')
% Use a discreet colormap so that we can simulate speckles.
colormap([1 .7 .1
.3 .4 .2])
axis equal off
% Setup lighting parameters.
% lighting g % Not enough chars.
material([.6 1 .3])
camlight
Remix Tree