简体   繁体   中英

How do you remove the intersection curve between two translucent surfaces

I am plotting two surfaces using surf and the FaceAlpha parameter. When FaceAlpha is less than 1, the surfaces are translucent and the curve of intersection shows up in white. Why does this happen, and how do you remove it?

在此输入图像描述

Code to reproduce in 2015b:

x = linspace(0, 1, 21);
y = linspace(0, 1, 21);
[x, y] = meshgrid(x, y);
z1 = x;
z2 = y;
hold off
surf(x, y, z1, 'FaceAlpha', 0.2)
hold on
surf(x, y, z2, 'FaceAlpha', 0.2)

Contrast this with:

hold off
surf(x, y, z1)
hold on
surf(x, y, z2)

This seems to be a problem with OpenGL. Change the renderer to painters and the white line disappears:

set(gcf, 'Renderer', 'painters')

(tested on Mac OS 10.11.1 and MATLAB 2015b)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM