Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Pygame 3D:如何实现,可能吗?_Python_Performance_Dictionary_3d_Pygame - Fatal编程技术网

Python Pygame 3D:如何实现,可能吗?

Python Pygame 3D:如何实现,可能吗?,python,performance,dictionary,3d,pygame,Python,Performance,Dictionary,3d,Pygame,所以我想在pygame中编程一个3d网格查看器,不需要其他第三方模块(panda3d非常完美,但它非常复杂)。我的想法是: list_of_surfs = {'85 50':'70deg'} #the 85 50 and the dimensions of the #side/surf, and 70 deg of rotation to be able to see it, then i would like #stretch it and scale it for it to seem 3

所以我想在pygame中编程一个3d网格查看器,不需要其他第三方模块(panda3d非常完美,但它非常复杂)。我的想法是:

list_of_surfs = {'85 50':'70deg'} #the 85 50 and the dimensions of the 
#side/surf, and 70 deg of rotation to be able to see it, then i would like
#stretch it and scale it for it to seem 3-dimensional.

有什么想法吗?这似乎也不起作用;这太复杂,太耗时了。那么我如何制作一个纯Pygame 3d网格查看器呢?任何帮助都将不胜感激。

Pygame本机不具备此功能。如果你真的想这样做,你需要刷你的三角映射线从三维空间到二维屏幕。在这一点上,你将基本上重新实现一个3D引擎。

只是一个想法:如果你能写一个更好的标题来陈述你的问题,你可能会吸引更多更好的答案。试试PyOpenGL。它与pygame兼容,可以渲染3D内容而不需要3D-2D转换。顺便说一下,只要你愿意使用线框显示,这并不像听起来那么难。你只需要在屏幕上平移一个3D点,然后显示一个三角形,你只需要在这些平移点之间画线。你不需要担心纹理或深度缓冲,或者3D引擎通常关心的任何其他东西。