python 是用于实现我的第一个 3D 模型的语言的不错选择吗?
我是C/C/Java程序员,但最近我开始学习Python。
此外,我的学习科目是 3D 图形学。我必须使用动态相机创建我的公寓的 3D 模型。我想知道通过用 python 编写这个 3D 模型来合并这两个问题是否是一个好主意。
然而正如我所说,我是一个Python初学者,所以我不知道Python可以在这个领域给我带来哪些可能性。哪个库/引擎最适合入门?
I am C/C /Java programmer, but lately I have started learn Python.
Moreover I have 3D Graphics on my studies. I have to create 3D model of my apartment, with dynamic camera. I am wondering if this is a good idea to merge this two issues, by writing this 3D model in python.
However as I said, I am a python beginner, so I don't know possibilities, which python can give me in this area. Which libraries/engine will be the best for a start?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您还可以查看 Pyglet,这是一个用于 OpenGL 的高级库。
You can also checkout Pyglet, which is a higher-level library for using with OpenGL.
恕我直言,C++ 对于 3D 图形来说是更好的选择,并且您有这方面的经验。
尽管您可以查看 PyOpenGL,OpenGl 的 python 绑定。
IMHO C++ is a better option for 3D graphics, and you have experience in it.
Though you can have a look at PyOpenGL, python bindings for OpenGl.
如果您只是想学习如何制作 3D 模型,请选择您最熟悉的语言。在这种情况下,我建议使用 C++ 或 C#(无论您对第二个 C 指的是哪一个)。
如果你还想了解更多关于该语言的知识,Python 是更好的选择。
但就纯粹的语言而言,我不会说 C++/c#/python 胜过其他语言。
If you're solely trying to learn how to do a 3d model go for the language you're the most familiar with. I'd recommend C++ or C# in that case (whichever of the 2 you meant with the second C).
If you also want to learn more about the language Python is the better choice.
But pure language wise I wouldn't say that C++/c#/python beats the other.
无论您选择哪种语言,都有很多选项和库。但如果您需要一个快速而肮脏的模型,您可能需要查看 VPython,它是 python 加上一个简单的 3D 库 (http://vpython.org/index.html。有视频教程:http://www.youtube.com/vpythonvideos
使用 VPython 进行编程可能会非常容易。
困难的部分是创建对象对于您的公寓,您可能需要手动进行坐标编码以定义每个对象 VPython 站点有一个用于导入 .stl 文件的实用程序,并且许多 3D 程序(例如 Blender)将导出 .stl 文件。 (我从未使用过这个,所以我无法评价它的效果如何)。
如果您只需要对墙壁、地板和天花板以及一两个简单的物体进行建模,那么这并不难。在方格纸上手工编写坐标并记下 z 轴值。
There are a lot of options and libraries regardless of the language you choose. But if you need a quick and dirty model you might want to check out VPython, which is python plus a simple 3D library (http://vpython.org/index.html. There are video tutorials at: http://www.youtube.com/vpythonvideos
The programming part would likely be very easy using VPython.
The hard part is creating the object for your apartment, which you might have to do by hand, with hand coding of the coordinates to define each object. The VPython site has a utility for importing .stl files, and many 3D programs, e.g., Blender, will export .stl files. (I've never used this, so I can't speak to how well it works).
If you just need to model the walls, floor, and ceiling, and maybe a simple object or two, it wouldn't be hard to hand-code the coordinates. Sketch it out on graph paper and make notes of the z axis values.