MATLAB: Does the alpha data have no effect on a surface object in MATLAB 7.4(R2007a)

alphachangedataeffectfigureimageMATLABobjectsurface

I am using the WARP command to display my image as a texture-mapped surface. I set the 'AlphaData' to a custom alpha data and 'AlphaDataMapping' to 'None'. However the figure transparency is not set.
I = imread('rice.png');
[h,w,d] = size(I);
[X,Y] = meshgrid(1:w,1:h);
alphaVal = X / w;
figure(1); clf;
h=warp(I);
set(gcf,'renderer','opengl');
set(h,'AlphaData',alphaVal,'AlphaDataMapping','none');

Best Answer

The transparency of the surface faces is controlled by the 'FaceAlpha' property. By default, this property is set to be 1 (a scalar) which represents full opacity.
The property needs to be set to 'texturemap' so as to use transparency for the texturemap. The sample code is shown below:
I = imread('rice.png');
[h,w,d] = size(I);
[X,Y] = meshgrid(1:w,1:h);
alphaVal = X / w;
figure(1); clf;
h=warp(I);
set(gcf,'renderer','opengl');
set(h,'FaceAlpha', 'texturemap', 'AlphaDataMapping', 'none', 'AlphaData',alphaVal);