I am trying to figure out how to import .obj files generated using Blender into my Pyglet game. There is an importer object, example code, and an example .obj/.mtl file within Pyglet's contrib directory.

The pyglet contrib version works (and is flickery; comment out w.flip) with the pyglet/contrib .obj/.mtl files. When I try to run it with my .obj and .mtl files I get a blank screen.

Why am I seeing a blank screen instead of my Blender-generated object?

FWIW, here's my test repo.

  • 2
    \$\begingroup\$ "Debug my code for me" questions are really too localised for this site. Your best bet is to teach yourself to use a debugger, and trace through your program's execution yourself to work out what's going wrong. \$\endgroup\$ Jan 6 '13 at 5:33

There were no normals, so nothing was displaying. I updated the git repo to warn on missing normals.

Unfortunately, I have no ground-breaking debugging techniques to report. I opened up the working .obj file and the "broken" .obj file, and by comparing them I noticed that one of the files had normals, and the other one didn't.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.