gpt4 book ai didi

matlab - 补丁透明度问题 (FaceAlpha)

转载 作者:太空宇宙 更新时间:2023-11-03 20:01:00 25 4
gpt4 key购买 nike

我在使用 Windows xp 的 Matlab 2010b 中绘制补丁时遇到了一些奇怪的问题。
当我尝试绘制以下补丁时,我得到的补丁不是全部填充,而是有一些空白部分。

如果我将渲染器设置为“画家”(见下文),这可以解决,
但是我不能改变补丁的透明度。
有没有人遇到过类似的问题?任何解决方法?

x = [734608.791666667;734608.843750000;734609;734609.041666667;734609.086805556;734609.125000000;734609.250000000;734609.277777778;];
y = [85.7847149493030;95.4499999983124;96.4800000077516;112.549999984098;109.949999996456;118.299999970804;120.450000002981;112.600000008944;];

figure;
set(gcf, 'Renderer', 'opengl');
patch(x, y, 'r');
title('this plot is with wrong vertices positions');

figure;
set(gcf, 'Renderer', 'painters');
patch(x, y, 'r', 'FaceAlpha', 0.1);
title('this plot is OK, but renderer ignores the transparency');

figure;
set(gcf, 'Renderer', 'opengl');
patch(x, y, 'r', 'FaceAlpha', 0.1);
title('this plot is with wrong vertices positions, but with transparency');

最佳答案

问题似乎源自 MATLAB -> OpenGL 渲染管道某处的浮点精度(我的猜测)。

如果你操纵 x 来:

x = [734608.791666667;734608.843750000;734609;734609.041666667;734609.086805556;734609.125000000;734609.250000000;734609.277777778;];
x = (x - mean(x));

这些情节似乎工作正常。

关于matlab - 补丁透明度问题 (FaceAlpha),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7318156/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com