3d 动画 - WPF 或 XNA

发布于 2024-12-10 10:51:45 字数 1432 浏览 0 评论 0原文

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

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

发布评论

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

评论(3

究竟谁懂我的在乎 2024-12-17 10:51:45

在我目前正在进行的项目中,我们同时使用 WPF 和 XNA 进行 3D 渲染。 XNA 的内容是在 WPF 应用程序中使用的,因此将这两者结合使用也没有问题。

如果您有一个简单的场景,我会使用 WPF 进行 3D 渲染,因为我喜欢它为您提供的抽象。您只需将对象添加到场景中,设置一些摄像机和灯光,其余的事情就会为您处理。我们使用 WPF 作为包含多达 500 个圆柱体的可视化编辑器,没有任何性能问题。我们遇到的一个性能问题是从场景中添加/删除对象需要很长时间。因此,如果您需要做很多事情,那么 WPF 不太适合。

但是,如果您有更复杂的需求或者应用程序对性能至关重要,我会选择 XNA 以更接近金属。它为您提供了一种更“经典”、类似 OpenGL 的渲染方法。

总结一下:

WPF:

  • 使用简单
  • 良好的抽象
  • 整体性能良好
  • 添加/删除对象时性能较差

XNA:

  • 接近金属
  • 良好的性能
  • 如果您使用的话,感觉更像 OpenGL可以
  • 与 WinForms 和 WPF 一起使用

我们用于 WPF 方面的资源是 Charles Petzold 的关于该主题的著作。我们目前使用他图书馆中的东西。它让我们很快就开始了,但我们遇到了一些问题,所以我建议谨慎一些。然而,他网站上的东西值得一看。

We use both WPF and XNA for 3D rendering in the projects I'm currently working on. The XNA stuff is used from within a WPF application, so there is no problem using those two combined either.

I would use WPF for the 3D rendering if you have a simple scene since I like the abstraction it gives you. You simply add objects to the scene, set up some cameras and lights and the rest is handled for you. We use WPF for a visual editor containing up to ~500 cylinders without any performance problems. The one performance issue we have had is that it takes a long time to add/remove objects from the scene. So WPF is not a good fit if that is something you need to do a lot of.

However, if you have more complex needs or if the application is performance critical I would go with XNA to get closer to the metal. It gives you a more "classic", OpenGL like approach to rendering.

To summarize:

WPF:

  • Simple to use
  • Nice abstraction
  • Ok performance overall
  • Poor performance when adding/removing objects

XNA:

  • Close to the metal
  • Good performance
  • Feels more like OpenGL if you are used to that
  • Works with both WinForms and WPF

A resource that we have used for the WPF side of things is Charles Petzold's writings on the subject. We currently use stuff from his library. It got us started quickly, but we've had some issues, so I would recommend some caution. However, the stuff on his site is worth looking at.

萌逼全场 2024-12-17 10:51:45

XNA + WPF 是解决方案。本文将指导您完成该过程:http://www.codeproject。 com/Articles/38301/XNA-integration-inside-WPF

对于大量 3D 工作来说,XNA 无疑更快、更方便。 WPF 适合 3D,但 XNA 更易于调试,并提供了一些不错的功能,例如附加 alpha 混合和相机对象。此外,您还可以找到好的图书馆来支持您的工作。

如果您不确定,那么您无疑应该使用 XNA 对象来绘制图形。 WPF 将为您提供按钮和文本,而这在 XNA 中却是一种痛苦。

XNA + WPF is the solution. This article will guide you through the process: http://www.codeproject.com/Articles/38301/XNA-integration-inside-WPF

Definetely XNA is faster and more convenient for extensive 3D work. WPF is fine for 3D, but XNA is easier to debug and offers several nice features, such as additive alpha blending and a Camera object. Also, you can find good libraries to support your work.

If you are not sure, then you should without doubt use an XNA object to draw the graphics. WPF will provide you with buttons and text, which, in turn, are a pain in XNA.

Spring初心 2024-12-17 10:51:45

Xna 将提供更轻松的 3d 方面调试。

您可以按照 winforms 示例在 Windows 窗体中托管 xna,然后所有熟悉的控件(如下拉菜单和按钮)都将正常工作并与 xna 交互。

Xna will offer easier debugging of the 3d aspects.

You could follow the winforms example to host xna in a windows forms form and then all the familiar controls like drop downs and buttons will work fine and interact with xna.

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