简体   繁体   English

C#vs.Python-2D / 3D图形模拟器的最佳选择

[英]C# vs. Python - Best choice for a 2D/3D graphic simulator

As the title suggests it, I`m looking for the best solution for creating a 2D or a 3D graphic simulator. 顾名思义,我正在寻找创建2D或3D图形模拟器的最佳解决方案。 I need to build a program that simulates the behavior of some custom solar panels (how the rays fall on the surface of the panels, what happens if the panels are rotated etc). 我需要构建一个程序来模拟某些自定义太阳能电池板的行为(光线如何落在电池板表面上,如果电池板旋转会发生什么情况等)。 The main problem is that it has to be done in a very short amount of time and depending on how big the difference between the 2D and the 3D one will be (in terms of needed time for completion), I will choose the most appropriate solution. 主要问题是必须在很短的时间内完成,并且取决于2D与3D之间的差异有多大(就完成所需的时间而言),我将选择最合适的解决方案。 The program has to create also some charts based on the input data. 该程序还必须根据输入数据创建一些图表。

Thus, I`m interested looking for you suggestions in regard to which one of the aforementioned languages would provide the best and easiest to use tools (for both the 2D and the 3D one), and a good combination of the final code complexity, ease of the graphic design and final appearance. 因此,我很想为您提供建议,涉及上述哪种语言将提供最佳和最容易使用的工具(对于2D和3D而言),以及最终代码复杂性,易用性的良好组合图形设计和最终外观。

If you don't have much time you should choose the language you know better. 如果您没有太多时间,则应该选择更了解的语言。

Personally I'd go for python because I think it's a very productive language. 就个人而言,我会选择python,因为我认为它是一种非常有生产力的语言。 To do the rendering I'd rely on the module pygame. 要进行渲染,我将依靠pygame模块。 Nevertheless there are numerous possible libraries that can do what you need. 尽管如此,仍有许多可能的库可以满足您的需求。 I've used XNA a while ago and it was a real pleasure. 我前一段时间使用过XNA,这是我的荣幸。 Especially its support for 2d graphics is excellent. 特别是它对2d图形的支持非常出色。 On the bottom-line I guess it boils down to this: 最重要的是,我可以归结为:

Python is "working pseudo code". Python是“有效的伪代码”。 It will allow you to code the logic very efficiently. 这将使您非常有效地对逻辑进行编码。 Pygame however is a 3d game library. 但是,Pygame是3D游戏库。 It's great for creating games and visualizations but you'll have trouble to make a nice gui. 这对创建游戏和可视化效果非常有用,但是您很难制作出精美的GUI。

C# is a little more "heavy" than python. C#比python更“沉重”。 You'll definitely end up writing more code, just in terms of the number of lines. 仅就行数而言,您肯定会最终编写出更多代码。 XNA + WPF is a powerful combo though and has very good tools - VisualStudio has a great gui designer XNA + WPF是一个功能强大的组合,并且具有非常好的工具-VisualStudio具有出色的GUI设计器

I haven't tried graphics in python yet, but worked with XNA Game Studio (for .Net framework) for a while and think that it's quite easy to use and powerful. 我还没有尝试过使用python进行图形处理,但是已经与XNA Game Studio (用于.Net框架)合作了一段时间,并认为它非常易于使用且功能强大。 So it's worth to have a look. 因此值得一看。 Never mind its name, it's not only for games. 不用管它的名字,它不仅适用于游戏。

I don't know much about C#, but Python has quite a number of modules that you probably could use. 我对C#不太了解,但是Python可能有很多模块可以使用。 Someone already mentioned Pygame, for 3D visualization you can use for example Vpython or Panda3D . 有人已经提到过Pygame,对于3D可视化,您可以使用VpythonPanda3D There is a nice lists of 3D software for Python or written in Python at this website . 此网站上有很多不错的Python 3D软件或用Python编写的3D软件列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM