Display question about transparent intersected surfaces
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hao Li
am 10 Jul. 2018
Beantwortet: Hao Li
am 13 Jul. 2018
Why when I set the intersected surfaces' transparent with 'FaceAlpha', the intersected regions display invalid.
Code:
x=[0:0.01:3];
y=[0:0.01:5];
[X,Y]=meshgrid(x,y);
Z1=X*1.1+Y*1;
Z2=X+Y*1.1;
mesh(X,Y,Z1,'FaceColor','b','EdgeAlpha',0,'FaceAlpha',0.5)
hold on
mesh(X,Y,Z2,'FaceColor','r','EdgeAlpha',0,'FaceAlpha',0.5)
The figure
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191768/image.jpeg)
3 Kommentare
Jan
am 10 Jul. 2018
Which Matlab version are you using? Is OpenGL set to hardware or software?
I can reproduce this effect with Matlab online.
Akzeptierte Antwort
Wentao Du
am 13 Jul. 2018
This issue is due to the Order Independent Transparency method used by MATLAB called "Depth Peeling." Unfortunately, there are no existing workarounds.
Changing to "opengl" setting to "hardwarebasic" gives a slightly better result, as this triggers the transparency to use an "object sort" method (Typically this is worse than any Order Independent Transparency method). Or you may use the "painters" renderer for the figures created by executing the following:
>> set(gcf,'Renderer','painters');
Our development team is looking into addressing this issue and it will be considered for a future release of MATLAB.
0 Kommentare
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Graphics Performance finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!