有没有办法用C#在winforms或WPF中制作3D游戏?
我正在考虑制作一款 3D 点击游戏,是否可以在 winforms 或 WPF 中制作一款?我不需要任何物理或任何东西,我所需要的只是让应用程序渲染 3D 对象。我知道我可以使用 XNA,但如果我这样做,我将不得不重新学习几乎所有内容。我的第三种方法是在 3D 游戏引擎中制作场景,然后打印屏幕,然后将其加载为图像。任何建议将不胜感激。
I'm thinking about making a 3D point and click game, is it possible to make one in winforms or WPF? I don't need any physics or anything all I need is to make the application render 3D objects. I know that I can use XNA but if I do then I will have to relearn almost everything again. My third approach would be to make the scenes in a 3D game engine and then print the screen and then load it as a image. Any suggestion would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
3D 游戏与仅让玩家与渲染图像进行交互之间存在很大差异。
您加载预渲染图像的方法可以在 Winforms 和 WPF 中执行。您只需要捕获图像上的点击事件并根据活动区域列表检查位置。然后只需处理需要完成的操作,即:移动到下一个区域、激活项目等。
从评论中编辑:
并不是哪个更友好。您可以在 Winforms/WPF 中托管 XNA 视口。更重要的是您希望游戏如何运行。如果您从来没有移动的 3D 场景,XNA 就太过分了,而且图像也可以正常工作。
如果您想要动态场景,则需要能够动态渲染它们。那么,XNA 就更有意义了。与仅显示图像相比,这需要做更多的工作。
There's a big difference between a 3D game, and just letting players interact with a rendered image.
Your approach of loading a pre-rendered image is possible to do in both Winforms and WPF. You would just need to capture click events on the image and check the location against your list of active areas. Then just handle what needed to be done, ie: move to the next area, activate item, etc.
Edit from comment:
It's not so much which is friendlier. You can host an XNA viewport in Winforms/WPF. It's more about how you want your game to work. If you never have moving 3D scenes, XNA is overkill, and images will work just fine.
If you want dynamic scenes, you'll need to be able to render them on the fly. Then, XNA makes more sense. It is a lot more work though compared to just displaying images.
如果您只想在游戏中显示预渲染的 3D 图像,为什么不使用真正的 3D 图形工具(例如 3D Studio Max 或 Maya)(或免费工具,例如 Blender)来创建它们呢?听起来根本不需要在游戏引擎中实际渲染 3D 场景。
If you just want to show pre-rendered 3d images in your game, why not create them using a real 3d graphics tool, such as 3D Studio Max or Maya (or a free one, such as Blender)? It sounds like there's no need for actually rendering the 3d scenes in a game engine at all.