4

I have been trying to build a game using pandas3D and I saw the load model function only uses x, bam and egg. files.

But I only have obj files.

How can I load obj models to pandas? I have tried converting from .obj to .x but pandas gives me an error.

Unable to open X file: /c/Users/inbar/PycharmProjects/untitled3/3D/v1.x :xfile(error): Cannot open /c/Python27/etc/../v1.x for reading. Unable to open X file: /c/Python27/etc/../v1.x :xfile(error): Cannot open /c/Python27/etc/../models/v1.x for reading. Unable to open X file: /c/Python27/etc/../models/v1.x :loader(error): Couldn't load file v1.x: all matching files on model path invalid (the model path is currently: "/c/Users/inbar/PycharmProjects/untitled3/3D;/c/Python27/etc/..;/c/Python27/etc/../models") Traceback (most recent call last): File "C:/Users/inbar/PycharmProjects/untitled3/3D/panda3d tutorial.py", line 146, in app = MyApp() File "C:/Users/inbar/PycharmProjects/untitled3/3D/panda3d tutorial.py", line 32, in init self.surface =loader.loadModel("v1.x") File "C:\Python27\direct\showbase\Loader.py", line 170, in loadModel raise IOError, message IOError: Could not load model file(s): ['v1.x']

after using Obj2Egg i got this errror C:\Users\inbar\Desktop\t>obj2egg.py -n30 -b -t -s OBJ.obj option -t not recognized

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/)
j.doe
  • 57
  • 1
  • 3

1 Answers1

7

You can in fact load .obj model files in Panda3D, starting from version 1.10. Just add load-file-type p3assimp to your config.prc file in the etc folder of your Panda3D installation, and you can then load .obj models using model = self.loader.load_model("my_model.obj").

kCODINGeroo
  • 443
  • 4
  • 13