MATLAB: How to create a transparent sphere

spheretransparency

I have created a sphere using the [x,y,z} = sphere() function however, when I go to use alpha(.15) to try and add some transparency it just keeps giving me a dark sphere… I also tried using the following code;
[x,y,z] = sphere(128); colormap(hot(256)); shl = surfl(2*x,2*y,2*z); hold on; sh2 = surfl(2*x, y, 2*z); alpha(shl,.15) shading interp;
but this simply gives me two spheres one that is a block colour inside a larger transparent sphere. Any idea what the issue is
Many thanks

Best Answer

[x y z] = sphere(128);
h = surfl(x, y, z);
set(h, 'FaceAlpha', 0.5)
shading interp
Related Question