在 Papervision3D 中将 MovieMaterial 置于 DAE 模型后面

发布于 2024-08-30 19:51:46 字数 462 浏览 6 评论 0原文

我正在使用 FLARManager 增强现实和 Papervision3D 库做一个项目。不幸的是,Papervision 给我带来了很多问题。

我的 scene3D 包含一个 DAE 模型和一个平面。该飞机有一个 MovieMaterial,并且正在通过 FLVPlayback 播放视频。 DAE 和平面都位于同一个 DisplayObject3D 容器内。 FLARManager 转换容器,以便所有内容都通过标记的角度显示。

我的DAE型号是电视,电视的屏幕是透明的。我希望将我的飞机放在我的 DAE 模型中,以便在飞机材质上播放的电影看起来就像在电视上播放的一样。

问题是,即使飞机的 Z 指数比电视低,它也总是出现在电视前面。

如何让我的飞机及其电影材质出现在电视后面,以便其某些角被电视切掉,而电视的透明部分让我可以看到电影?如果不可能,有人知道如何在我的 DAE 电视型号的屏幕上获得理想的电影播放效果吗?

谢谢。

I'm doing a project using FLARManager augmented reality and the Papervision3D library. Unfortunately, Papervision is giving me a lot of problems.

My scene3D contains a DAE model and a plane. The plane has a MovieMaterial and is playing a video through FLVPlayback. The DAE and the plane are both inside the same DisplayObject3D container. FLARManager transforms the container so that everything appears through the angle of the marker.

My DAE model is a TV, the screen of the TV is transparent. I want to have my Plane inside of my DAE model, so that the Movie playing on the plane material appears to be what is playing on the TV.

The problem is that, even if the plane has a lower Z index then the TV, it always appears in front of the TV.

How do I have my plane and its MovieMaterial appear behind the TV, so that some of its corners are cut out by the TV and the part of the TV thats transparent let me see the Movie? If its impossible, anyone has an idea of how I could get the desired effect of having a movie play on the screen of my DAE tv model?

Thank You.

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

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

发布评论

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

评论(1

月寒剑心 2024-09-06 19:51:46

我们自己想出来的。如下:

当您有一个 DAE 模型并且想要将其放在 ViewportLayer 上时,您需要确保递归 DAE 模型,以便将其所有子项添加到该图层上。

这就是你如何做到的:

var daeViewportLayer:ViewportLayer = viewport.containerSprite.getChildLayer(aDae, true, true);

重要的是第三个参数,recurse = true,这会将 DAE 及其所有子级放在该层上。

viewport.containerSprite 可以替换为 DAE 模型的任何父 DisplayObject3D。

Figured it our myself. Here goes:

When you have a DAE model and you want to put it on a ViewportLayer, you need to make sure to recurse through the DAE model, so that all its children get added onto the layer.

this is how you do it:

var daeViewportLayer:ViewportLayer = viewport.containerSprite.getChildLayer(aDae, true, true);

What's important is the third parameter, recurse = true, this will put the DAE and all its children on the layer.

viewport.containerSprite can be replaced by any parent DisplayObject3D of the DAE model.

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