【问题标题】:Pandas 3D obj model loadingPandas 3D obj 模型加载
【发布时间】:2018-11-21 16:50:46
【问题描述】:

我一直在尝试使用 pandas3D 构建游戏,我看到加载模型函数仅使用 x、bam 和 egg。文件。

但我只有obj 文件。

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

无法打开 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”) Traceback(最近一次通话最后一次):文件 "C:/Users/inbar/PycharmProjects/untitled3/3D/panda3d tutorial.py", 第 146 行,在 app = MyApp() 文件“C:/Users/inbar/PycharmProjects/untitled3/3D/panda3d tutorial.py”, 第 32 行,在 init 中 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 选项 -t 无法识别

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/)

【问题讨论】:

    标签: python pandas 3d


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2017-01-28
      • 2013-09-27
      • 1970-01-01
      • 1970-01-01
      • 2021-04-06
      • 2020-07-16
      • 2016-11-18
      • 1970-01-01
      • 2020-08-05
      相关资源
      最近更新 更多