简体   繁体   English

是否可以将3D模型导入pyglet?

[英]Is it possible to import a 3D model into pyglet?

Me and a friend are working on an openGL game written in python, using the pyglet library. 我和一个朋友正在使用pyglet库开发用python编写的openGL游戏。 Now we finished the map drawing code, and have come to a point where we need to import some models that will be displayed on the map. 现在我们完成了地图绘制代码,并且我们需要导入一些将在地图上显示的模型。 Pyglet doesn't seem to support it, apart from some old SVN code, apparently (I googled a bit around with not much luck). Pyglet似乎并不支持它,除了一些旧的SVN代码之外,显然(我用一点点数据并没有太多运气)。 Does anyone know a good python script/library that can import 3D models? 有谁知道一个可以导入3D模型的好的python脚本/库?

Open Asset Import Library (Assimp) supports ~35 different 3D file formats. Open Asset Import Library (Assimp)支持~35种不同的3D文件格式。

It has python bindings in its repository, but I don't know for sure if they're up-to-date and feature-complete. 它在其存储库中有python绑定,但我不确定它们是否是最新的和功能完整的。 Still, assimp might be worth a try (even though I am not unbiased since i'm one of its founders). 尽管如此,assimp可能值得一试(尽管我不是不偏不倚的,因为我是其创始人之一)。

There are 3D models and 3D models. 有3D模型和3D模型。 The ease of import will depend on the complexity of the model and which format you have the model data in. Blender includes several python scripts to import model data into blender specific mesh, and export to other formats. 导入的简易性取决于模型的复杂程度以及模型数据的格式.Blender包含几个python脚本,用于模型数据导入到特定于blender的网格中,并导出为其他格式。 You can look there for inspiration. 你可以在那里寻找灵感。

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

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