Thu 26 Nov 2015 09:13:25 AM UTC, original submission:
Hi,
the attribute FaceAlpha is not working correctly.
Any other value than 1 leads to no color at all.
Here is a small example:
T =[
1 2 4
2 3 5
4 5 7
5 6 8
5 4 2
6 5 3
8 7 5
9 8 6];
P = [
0.00000 0.00000 0.00000 0.50000 0.50000 0.50000 1.00000 1.00000 1.00000
0.00000 0.50000 1.00000 0.00000 0.50000 1.00000 0.00000 0.50000 1.00000];
x = P(1,:); y = P(2,:);
z = 1 - (x-0.5).^2 - (y-0.5).^2;
i=1:length(T);
a1 = [ x(T(i,1)) ; y(T(i,1)) ; z(T(i,1)) ];
a2 = [ x(T(i,2)) ; y(T(i,2)) ; z(T(i,2)) ];
a3 = [ x(T(i,3)) ; y(T(i,3)) ; z(T(i,3)) ];
s = ( a1(1:2,i) + a2(1:2,i) + a3(1:2,i) )./3;
r1 = a3(:,i) - a1(:,i);
r2 = a2(:,i) - a1(:,i);
n = cross(r1,r2);
dx = n(1,:)./n(3,:);
%dy = n(2,:)./n(3,:);
patch('Faces',T,'Vertices',P','FaceVertexCData',dx','FaceColor','flat','FaceAlpha',1);
Kind regards
|