Why does FaceAlpha affect ZData of different object?
Mostra commenti meno recenti
Hi,Im working with matlab 2015a in linux.
trying this code (with the slice grid ,x and y in the mat file attached)
if true
clear
clc
load('FaceAlpha.mat'); % Loading SliceGrid and X,Y parametrs
hold on; xlabel('X'), ylabel('Y'), zlabel('Z'); axis equal;
axis image;
plot(SliceGrid.x(X),SliceGrid.y(Y),'blue.');hold on;
h=[-8 -0.5 0.5 1]
v=[7 4 4 7];
fill_2=fill(h,v,'blue'); % Creating blue object
x=[0 -0.5 0.5 1]
y=[9 4 4 9];
fill_1=fill(x,y,'red');% Creating red object
t=[-2 -0.5 0.5 2]
z=[9 2 2 0];
fill_3=fill(t,z,'yellow'); % Creating yellow object
%%%%%%%%%%%%
%%%%%%%%%%%%
%%%%%%%%%%%%
set(fill_1,'FaceAlpha',0.5); % After this line everthing is ok.
set(fill_2, 'ZData', repmat(10, size(get(fill_2, 'XData')))); % After this line the outside blue plot is damaged
%%%%%%%%%%%% - as you can see in the above figure
%%%%%%%%%%%%if we omit the line -> set(fill_1,'FaceAlpha',0.5);
%%%%%%%%%%%%and leave the code with the ZData property, the outside blue plot doesn't damaged.
%%%%%%%%%%%%if we omit the line -> set(fill_2, 'ZData', repmat(10, size(get(fill_2, 'XData'))));
%%%%%%%%%%%%and leave the code with the FaceAlpha property, the outside blue plot doesn't damaged.
end
why and how does face alpha affect other object with ZData? and why are they doesn't work together? what is wrong?
Risposta accettata
Più risposte (2)
Vivek Jadye
il 23 Nov 2015
2 voti
This issue is fixed in MATLAB R2015b.

The root cause of the problem is the fact that, in absence of a global anti-alising technique, modern OpenGL drivers draw smooth round points by introducing a translucent halo at the periphery of points during rasterization; and this translucent region was being blended with an incorrect background. This means that we need to be extra careful while drawing points because even the points with opaque colors may still need blending with the correct background.
1 Commento
nad yah
il 24 Nov 2015
Walter Roberson
il 4 Ago 2015
0 voti
I have not run your code, but the most common problem when you use Alpha values is that it forces the OpenGL renderer to be used, which can result in different appearances than the other renderers.
Also as of R2014b some of the rendering details have changed. See http://www.mathworks.com/help/matlab/graphics_transition/why-are-some-components-missing-or-partially-obscured.html
1 Commento
nad yah
il 5 Ago 2015
Categorie
Scopri di più su Graphics Performance in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


