Pandas 3D obj 模型加载

j.d*_*doe 3 python 3d pandas

我一直在尝试使用 pandas3D 构建游戏,但我看到加载模型功能仅使用x,bamegg. 文件。

但我只有obj文件。

如何将obj模型加载到熊猫?我试过从 . obj到 。x但熊猫给了我一个错误。

无法打开 X 文件:/c/Users/inbar/PycharmProjects/untitled3/3D/v1.x :xfile(error): 无法打开 /c/Python27/etc/../v1.x 进行阅读。无法打开 X 文件:/c/Python27/etc/../v1.x :xfile(error): 无法打开 /c/Python27/etc/../models/v1.x 进行读取。无法打开 X 文件:/c/Python27/etc/../models/v1.x :loader(error): 无法加载文件 v1.x:模型路径上的所有匹配文件无效(模型路径当前为: “/c/Users/inbar/PycharmProjects/untitled3/3D;/c/Python27/etc/..;/c/Python27/etc/../models”)回溯(最近一次调用):文件“C:/ Users/inbar/PycharmProjects/untitled3/3D/panda3d tutorial.py”,第 146 行,在 app = MyApp() 文件“C:/Users/inbar/PycharmProjects/untitled3/3D/panda3d tutorial.py”,第 32 行,在在里面 self.surface =loader.loadModel("v1.x") 文件“C:\Python27\direct\showbase\Loader.py”,第 170 行,在 loadModel 中引发 IOError,消息 IOError:无法加载模型文件: ['v1.x']

使用 Obj2Egg 后,我得到了这个错误 C:\Users\inbar\Desktop\t>obj2egg.py -n30 -b -t -s OBJ.obj option -t notknowledge

This Version: $Id: obj2egg.py,v 1.7 2008/05/26 17:42:53 andyp Exp $
Info: info >at< pfastergames.com

Extended from: http://panda3d.org/phpbb2/viewtopic.php?t=3378
.___..__ .___.___.___.__..__ .  .
  |  [__)[__ [__ [__ |  |[__)|\/|
  |  |  \[___[___|   |__||  \|  |
obj2egg.py [n##][b][t][s] filename1.obj ...
    -n regenerate normals with # degree smoothing
        exaple -n30  (normals at less 30 degrees will be smoothed)
    -b make binarmals
    -t make tangents
    -s show in pview

licensed under WTFPL (http://sam.zoy.org/wtfpl/)
Run Code Online (Sandbox Code Playgroud)

小智 5

实际上,从版本 1.10 开始,您可以在 Panda3D 中加载 .obj 模型文件。只需添加load-file-type p3assimp到 Panda3D 安装的 etc 文件夹中的 config.prc 文件,然后您就可以使用 .obj 模型加载 .obj 模型model = self.loader.load_model("my_model.obj")