在 Papervision 2.0 中获取 3D 对象的 2D 屏幕坐标

发布于 2024-08-19 21:55:20 字数 283 浏览 2 评论 0原文

使用 Papervision 2.0 (Great White) 时如何获取 3D 对象的 2D 屏幕坐标?我读过以下属性应该返回屏幕坐标,但这些总是返回 0。

myDisplayObject3D.screen.x
myDisplayObject3D.screen.y

我也尝试过设置:

myDisplayObject3D.autoCalcScreenCoords = true;

但这没有效果。任何帮助将不胜感激。

How do I get the 2D screen coordinates of a 3D object when using Papervision 2.0 (Great White)? I've read that following properties should return the screen coords but these always return 0.

myDisplayObject3D.screen.x
myDisplayObject3D.screen.y

I've also tried setting:

myDisplayObject3D.autoCalcScreenCoords = true;

But this has no effect. Any help would be appreciated.

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

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

发布评论

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

评论(2

迷路的信 2024-08-26 21:55:20

事实证明,我试图在将对象添加到场景后但在渲染器下一个渲染周期之前立即读取这些值。我将上面的代码添加到我的输入帧侦听器中,所有后续跟踪都正常工作。

Turns out I was attempting to read the values immediately after adding the object to the scene but BEFORE the renderers next render cycle. I added the above code to my enter frame listener and all subsequent traces worked correctly.

烟─花易冷 2024-08-26 21:55:20

screen.x 和 screen.y 应该可以工作。您的 3D 对象是否已添加到场景中?

在在线文章中(pv3d.orgeverydayflash)一切看起来都很好。

您能否发布一个片段(要么隔离代码段,要么针对您的情况编写一个简单的类比),以便我们可以了解可能出现问题的线索?

screen.x and screen.y should work. Is your 3d object added to the scene ?

In the online articles(pv3d.org, everydayflash) all looks fine.

Could you post a snippet ( either isolate the bit of code, either write a simple analogy to your situation) so we can get a clue of what might be wrong ?

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