Papervision 的场景图实现?

发布于 2024-07-12 13:42:55 字数 263 浏览 10 评论 0原文

我正在尝试将 Papervision for Flash 用于我的这个项目,该项目涉及机械框架的 3D 模型,由多个连接的部件组成。 其中一个部件的移动会导致框架其他部件的方向和位置发生相应的变化。 我的理解是,使用场景图来处理这种链接运动将是理想的方法,至少,如果我要在更成熟的 3D 开发选项之一(例如 OpenGL 或 DirectX)中实现的话。 我的问题是,Papervision 是否有现有的场景图实现? 或者,有另一种方法来生成所需的 3D 运动吗?

感谢!

I'm trying to use Papervision for Flash, for this project of mine, which involves a 3D model of a mechanical frame, consisting of several connected parts. Movement of one of the parts results in a corresponding change in orientation and position of other parts of the frame.
My understanding is that using a scene graph to handle this kind of linked movement would be the ideal way to go, at least, if I were to implement in one of the more established 3D development options, like OpenGL or DirectX.
My question is, is there an existing scene graph implementation for Papervision? Or, an alternative way to generate the required 3D motion?

Thank!

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

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

发布评论

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

评论(2

瞎闹 2024-07-19 13:42:55

我认为 Papervision 基本上是一个基于 Flash 的 3D 渲染引擎,因此应该包含它自己的场景图。

请参阅 API 中的 org.papervision3d.scenes.Scene3D

请参阅这篇文章,了解更详细的解释Papervision 中的各种对象。 您可以做的一件事是在 google 上搜索包含 P3D 中关键对象的文章,例如 EngineManager、Viewport3D、BasicRenderEngine、Scene3D 和 Camera3D。

至于“生成运动”,这取决于您想要实现的具体目标。 您可以自己编写代码并更改场景,也可以使用物理库等第三方库,这样就不必自己编写所有代码。

I thought Papervision is basically a Flash-based 3D rendering engine, therefore should contain its own scene graph.

See org.papervision3d.scenes.Scene3D in the API.

And see this article for a lengthier explanation of the various objects in Papervision. One thing you can do is google for articles with the key objects in P3D, such as EngineManager, Viewport3D, BasicRenderEngine, Scene3D and Camera3D.

As for "generating the motion", it depends on what you are trying to achieve exactly. Either you code that up and alter the scene yourself, or use a third-party library like a physics library so as to not have to code all that up yourself.

柒夜笙歌凉 2024-07-19 13:42:55

您可以诚实地构建一个,所需时间与您搜索一个的时间相同:

使用虚拟方法 Render(matrix:Matrix) 创建一个名为 Node 的类,该类保存一组子节点。
创建一个名为 TransformNode 的 Node 子类,它引用一个矩阵。
创建一个名为 ModelNode 的 Node 子类,它引用模型。

TransformNode 的 Render 方法将传入矩阵与自己的矩阵相乘,然后使用结果矩阵调用其子级的 render 方法。

ModelNode 的 Render 方法将其模型发送到传入矩阵指定位置的渲染器。

就是这样。 您可以使用 BoundsNode 进一步增强功能,如果边界形状在视锥体中不可见,则该 BoundsNode 不会调用其子级。

You can honestly build one in the time it would take you to search for one:

Create a class called Node with a virtual method Render(matrix:Matrix), which holds an array of child nodes.
Create a subclass of Node called TransformNode which takes a reference to a matrix.
Create a subclass of Node called ModelNode which takes a reference to a model.

The Render method of TransformNode multiplies the incoming matrix with its own, then calls the render method of its children with the resulting matrix.

The Render method of ModelNode sends its model off to the renderer at the location specified by the incoming matrix.

That's it. You can enhance things further with a BoundsNode that doesn't call its children if it's bounding shape is not visible in the viewing frustum.

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