Facealpha bug in combination with 3D plots

2 次查看(过去 30 天)
when this three elements are combined, the smotthing of lines is lost.
- patch or fill3
- lines in the z axis (either with line or plot3)
- alpha (like FaceAlpha)
Examples:
figure() %line smoothing is OK
fill3([0 1 1 0],[0 0 1 1],[0 0 0 0],'b')
hold on
plot3([0; 0],[0; 0],[0; 1],'color','#D95319','LineWidth',1.5)
figure() %no line smoothing
patch([0 1 1 0],[0 0 1 1],'b','Facealpha',.5)
view([30 30])
line([0; 0],[0; 0],[0; 1],'color','#D95319','LineWidth',1.5)
as well:
figure() %no smoothing
fill3([0 1 1 0],[0 0 1 1],[0 0 0 0],'b','Facealpha',.5)
hold on
plot3([0; 0],[0; 0],[0; 1],'color','#D95319','LineWidth',1.5)
Do you have the same behaviour?

回答(1 个)

Voss
Voss 2023-2-9
You might try using the painters Renderer. See below for a comparison of those three cases with painters vs the default OpenGL Renderer.
figure('Renderer','OpenGL')
fill3([0 1 1 0],[0 0 1 1],[0 0 0 0],'b')
hold on
plot3([0; 0],[0; 0],[0; 1],'color','#D95319','LineWidth',1.5)
figure('Renderer','Painters')
fill3([0 1 1 0],[0 0 1 1],[0 0 0 0],'b')
hold on
plot3([0; 0],[0; 0],[0; 1],'color','#D95319','LineWidth',1.5)
figure('Renderer','OpenGL')
patch([0 1 1 0],[0 0 1 1],'b','Facealpha',.5)
view([-37.5 30])
line([0; 0],[0; 0],[0; 1],'color','#D95319','LineWidth',1.5)
figure('Renderer','painters')
patch([0 1 1 0],[0 0 1 1],'b','Facealpha',.5)
view([-37.5 30])
line([0; 0],[0; 0],[0; 1],'color','#D95319','LineWidth',1.5)
figure('Renderer','OpenGL')
fill3([0 1 1 0],[0 0 1 1],[0 0 0 0],'b','Facealpha',.5)
hold on
plot3([0; 0],[0; 0],[0; 1],'color','#D95319','LineWidth',1.5)
figure('Renderer','painters')
fill3([0 1 1 0],[0 0 1 1],[0 0 0 0],'b','Facealpha',.5)
hold on
plot3([0; 0],[0; 0],[0; 1],'color','#D95319','LineWidth',1.5)

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by