• Remix
  • Share
  • New Entry

on 19 Oct 2022
  • 6
  • 77
  • 0
  • 0
  • 248
% Color Cube made of blobs
% Step one, set of vertices that make up the cube.
n=5;
v=zeros(0,3);
for x=1:n
for y=1:n
for z=1:n
v(end+1,:)=[x y z];
end
end
end
% Create the blobs and call isosurface
b=64;
B=blinnblob(v*10,b,b,b);
S=isosurface(B,.5);
% Cube runs r,g,b across the 3 dims, same as the vertices
% so by rescaling vertices into 0..1, it will get the right colors.
S.FaceVertexCData=rescale(S.vertices,0,1);
% Make it look nice.
patch(S)
shading interp
lighting g
axis equal off
camlight
material([.6,.9,.3,2,.5]) % Remove much of the lighting effect to let the colors stand out.
view([160,30]);
Image
Remix Tree