在 Papervision 2.0 中获取 3D 对象的 2D 屏幕坐标
使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实证明,我试图在将对象添加到场景后但在渲染器下一个渲染周期之前立即读取这些值。我将上面的代码添加到我的输入帧侦听器中,所有后续跟踪都正常工作。
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.
screen.x 和 screen.y 应该可以工作。您的 3D 对象是否已添加到场景中?
在在线文章中(pv3d.org,everydayflash)一切看起来都很好。
您能否发布一个片段(要么隔离代码段,要么针对您的情况编写一个简单的类比),以便我们可以了解可能出现问题的线索?
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 ?