- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
也许这不是 Aframe 特有的,所以很抱歉,如果这更像是一个一般的 html 问题,但是如果您有一个具有透明度的 PNG 并将其放在另一个图像或不透明度小于 1.0 的任何对象的前面,则透明部分PNG 掩盖了它背后的东西。有没有办法在不将 PNG 定位在其他实体后面的情况下解决这个问题?
这是一个 png 在原语前表现出它应该如何表现的例子。它起作用是因为图元都处于完全不透明状态:
https://codepen.io/iBrews/pen/dWNymp
<script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
<a-assets>
<img id="pngImage" crossorigin="anonymous"
src="http://ekladata.com/hXTGfWnZm170W274zDRObDlqOlc.png">
</a-assets>
<a-scene>
<a-image position = "0 1.5 -1" width="1" height="1" src="#pngImage"></a-image>
<a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere>
<a-box position="-1 0.5 -3" rotation="0 45 0" width="1" height="1" depth="1" color="#4CC3D9"></a-box>
<a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
<a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
<a-sky color="#ECECEC"></a-sky>
</a-scene>
<script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
<a-assets>
<img id="transpImage" crossorigin="anonymous" src="http://ekladata.com/hXTGfWnZm170W274zDRObDlqOlc.png">
<img id="flatImage" crossorigin="anonymous" src="https://upload.wikimedia.org/wikipedia/commons/e/e9/Felis_silvestris_silvestris_small_gradual_decrease_of_quality.png">
</a-assets>
<a-scene>
<a-image position = "0 1.6 -1" width="1" height="1" src="#transpImage"></a-image>
<a-image position = "1 1.8 -1.5" width="1" height="1" src="#transpImage"></a-image>
<a-image position = "-.7 2 -1.5" width="1" height="1" src="#flatImage"></a-image>
<a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere>
<a-box position="-1 0.5 -3" opacity= ".5" rotation="0 45 0" width="1" height="1" depth="1" color="#4CC3D9"></a-box>
<a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D"></a-cylinder>
<a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
<a-sky color="#ECECEC"></a-sky>
</a-scene>
最佳答案
您可以将 Material 的 alphaTest 设置为 0.5。在 A-Frame 主机上(运送到 0.6.0),您可以执行以下操作:<a-image material="alphaTest: 0.5">
或者 <a-image alpha-test="0.5"></a-image>
在 A-Frame 0.5.0 上,您可以手动完成:
<script>
AFRAME.registerComponent('alpha-test', {
dependencies: ['material'],
init: function () {
this.el.getObject3D('mesh').material.alphaTest = 0.5;
}
});
</script>
<a-image src="#transpImage" alpha-test></a-image>
关于image - Aframe - 实体前透明的 PNG,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43638459/
我正在寻找一种经济合理的解决方案来长时间存储图片。我读到 PNG 文件格式,它与 JPEG 相比具有优越的特性,即在这些类别中: 无专利、无许可、无版税 无质量损失 尚未压缩 我有很多来自 Photo
关闭。这个问题是off-topic .它目前不接受答案。 想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。 9年前关闭。 Improve this q
我怎么能用 FFMEG 做到这一点? 输入 : 背景图片:background.png 图片帧列表:image_001.png,image_002.png ...(每张图片为一帧) 输出:所有帧都有背
$ cat png.ll ./packages/apps/Mms/res/mipmap-hdpi/ic_launcher_smsmms.png ./packages/apps/Mms/res/draw
这个问题在这里已经有了答案: Natural Sort Order in C# (18 个答案) 关闭 7 年前。 这是我的代码: private void Method1() { int
我一直在考虑用 Webp 图像替换我的 Android 应用程序中的 png 文件以减小 APK 大小。 虽然结果不错,但我想知道我是否使用了一些 png 转换器/压缩器,并且能够将尺寸减小到比我为
在 gnuplot-4.2.6 中,我可以使用 set term png medium x000000 xffffff set output 'file.png' plot x 这将生成一个带有黑色背
背景: 我正在努力使一堆 PNG 尽可能小。我正在使用诸如 PngOut、PngCrush 和 OptiPng 之类的工具。 问题: 我遇到了一个大小为 1434 KB 但只有 230 x 230 像
我正在使用 ImageMagick 调整图像大小。如果我传递 -resize WxH 选项,它会按预期运行。但是如果我通过 -resize WxH! (在调整大小时忽略纵横比),一些图像,尤其是 PN
如何访问/删除 PNG 元数据? 我正在寻找 Mac 应用程序或 PHP 代码段。 最佳答案 抱歉发布了一个 Windows 软件,但如果你没有找到任何对 MAC 有用的东西,那就是 TweakPNG
到目前为止似乎没有任何效果。我看到了 pnginfo以下消息: concept_Sjet_dream6.png... Image Width: 200 Image Length: 240 Bi
我有一个带有 Alpha channel (即透明度)的 PNG 图像,我需要创建将图像层合成到白色背景上的版本。我想使用可编写脚本的命令,使用 CLI 工具(例如 Image Magick)将 PN
我是初学者。我昨天问了一个类似的问题,但不知何故被否决了。所以这次我尽量简化问题。 带有 alpha png 的 24 位与 32 位 png 相同吗? 非常感谢您的一些提示。 最佳答案 没有“24
我有这个带点的荷兰 pdf 图像: pdf image of the netherlands with dots 当我尝试将此 pdf 转换为 png 图像时,使用 pdftools和 png像这样:
我在我的启动图像通用项目中添加了“Default.png,Default-568h@2x.png,Default@2x.png”这三个文件,我有三个不同的图像,分辨率与苹果中提到的完全相同文档,适用于
我在 Python 中使用 google app engine 并有几个静态 .png 图像文件,但它们都以“image/x-png”内容类型提供。这是一个问题,当我使用像 chrome 这样的浏览器
我做了一个 python 脚本,该脚本设法根据特定模式解散乱序(png)图像,该 python 脚本使用 ffmpeg 并进行 12 次编码来解乱它(通过裁剪特定部分并将其粘贴到现有图片上)。 因此,
我有一个 PNG 图像文件。我想将其转换为 GeoTiff。我安装了 QGIS 软件,但无法使用它,也不知道如何对图像进行地理配准。请帮我。有没有在线软件? 最佳答案 这是一个非常好的教程,其中包含有
我有一堆使用我编写的 Java 图表工具创建的图表 - 它们主要是黑白图表,带有浅绿色的块,偶尔还有其他颜色。它们当前被保存为 JPG 文件,我想将它们插入到我准备按需打印的书中。 这本书是一个 Op
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 7年前关闭。 Improve thi
我是一名优秀的程序员,十分优秀!