更改facealpha属性会导致人物自毁

发布于 2024-09-04 08:38:15 字数 998 浏览 3 评论 0原文

我正在 Snow Leopard 上运行 Matlab R2009b,并且尝试创建一个透明的多边形。以下行工作正常:

<块引用>

图,填充([1 0 0 1],[-1e-9 -1e-9 1e-9 1e-9],'r')

但是当我设置透明度时,

<块引用>

阿尔法(.5);

人物自行倒塌。也就是说,图中的任何标题、xlabel 和 ylabel 都会显示在中间,并且多边形会消失。

我得到相同的结果

<块引用>

图,填充([1 0 0 1],[-1e-9 -1e-9 1e-9 1e-9],'r','facealpha',.5)

当我手动设置时得到相同的结果在图形编辑器中将facealpha 更改为0.5。

但如果多边形更大,它就可以正常工作:

<块引用>

图,填充([1 0 0 1],[-1e-3 -1e-3 1e-3 1e-3],'r')
阿尔法(.5);

另外,我在电脑上尝试过,效果很好。

我想这一定是渲染的问题。我的opengl版本是:

版本 = 2.1 NVIDIA-1.6.10
供应商 = NVIDIA Corporation
渲染器 = NVIDIA GeForce 9400M OpenGL 引擎
最大纹理尺寸 = 8192
视觉 = 0x24(真彩色,深度 24,RGB 掩码 0xff0000 0xff00 0x00ff)
软件=假
扩展数量 = 121

我该怎么做才能让它正确显示?

I'm running Matlab R2009b on Snow Leopard, and I am trying to create a transparent polygon. The following line works fine:

figure,fill([1 0 0 1],[-1e-9 -1e-9 1e-9 1e-9],'r')

But when I set the transparency,

alpha(.5);

the figure collapses in on itself. That is, any title, xlabel, and ylabel I have in the figure show up right in the middle and the polygon disappears.

I get the same results from

figure,fill([1 0 0 1],[-1e-9 -1e-9 1e-9 1e-9],'r','facealpha',.5)

and I get the same result when I manually set the facealpha to .5 in the figure editor.

But if the polygon is bigger it works fine:

figure,fill([1 0 0 1],[-1e-3 -1e-3 1e-3 1e-3],'r')
alpha(.5);

Also, I tried it on a PC and it worked fine.

I think it must be a problem with the rendering. My opengl version is:

Version = 2.1 NVIDIA-1.6.10
Vendor = NVIDIA Corporation
Renderer = NVIDIA GeForce 9400M OpenGL Engine
MaxTextureSize = 8192
Visual = 0x24 (TrueColor, depth 24, RGB mask 0xff0000 0xff00 0x00ff)
Software = false
# of Extensions = 121

What can I do to get it to display properly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁人与我共长歌 2024-09-11 08:38:15

尝试查看 Mathworks 错误报告。我只有 PC 上的 MATLAB 副本,因此无法重现该错误,但是已知错误有解决方法。我不确定这是否是您正在处理的问题,或者是否是其他问题,但您可以在此处浏览更多错误报告:Mathworks 错误报告

Try checking out the Mathworks Bug Reports. I've only got a copy of MATLAB on PC, so I can't reproduce the error, but this known bug has a workaround. I'm not sure if that's what you're dealing with, or if it's something else, but you can browse more bug reports here: Mathworks Bug Reports

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文