0

This OBJ model does not import successfully into SceneKit.

(Model can be downloaded from the link.)

As you can see from the screenshot, there are a few polygons missing from the backpack (on the right hand side) when viewed from Xcode. However, the same model loads correctly in Blender, so it suggests there is nothing wrong with the file and something wrong with how SceneKit imports the model.

This also happens with a few other OBJ models from Google Polymer.

Do you need to do something else before importing OBJ models into SceneKit?

Model viewed on Google Polymer site: enter image description here

Model viewed in Xcode (missing polygons from backpack): enter image description here

Model in Blender with problematic polygon highlighted: enter image description here

Crashalot
  • 33,605
  • 61
  • 269
  • 439
  • If you look at the problematic polygons in Blender; where do their surface normals point (in or out)? Related: do these polygons show up if you modify the materials to be double sided? – David Rönnqvist Feb 15 '18 at 08:36
  • @DavidRönnqvist it seems out? New to Blender so not 100% sure but posted screenshot of the missing polygon highlighted in Blender. Thanks for your help! – Crashalot Feb 15 '18 at 08:46
  • @DavidRönnqvist also followed this answer (https://blender.stackexchange.com/questions/10711/double-sided-faces) to make the material double-sided, but it didn't seem to make a difference? – Crashalot Feb 15 '18 at 08:54
  • It's been a while since I used Blender but I think what you're seeing in that screenshot is the position of the selected face. As you are selecting other faces you should see that the direction of the red, green, and blue arrows don't change. There is a [mode where you can visualize the normals of all faces](https://docs.blender.org/manual/en/dev/modeling/meshes/editing/normals.html). Does that show the expected normals? – David Rönnqvist Feb 15 '18 at 08:55
  • likely a duplicate of [this question](https://stackoverflow.com/q/48179571/2997825). There is a "Triangulated OBJ File" download option for the model, does it work better? – mnuages Feb 15 '18 at 09:57
  • @mnuages yes the triangulated OBJ file looks great. any explanation for the disparity? thanks for the response! please ask mr. tim cook to spend some of apple's $200B+ cash on helping you and your team hire more people to accelerate scenekit development. :) – Crashalot Feb 15 '18 at 10:07
  • OBJ files are loaded through Model I/O and there was a bug in the way generic polygons were handled (triangles are treated differently). That bug seems to be fixed in the latest iOS and macOS betas. – mnuages Feb 15 '18 at 10:11
  • @mnuages btw mind sharing any insights on this lighting problem? we think this scenekit app could help expose 3D/AR to many more people, but need help getting over this hump: https://stackoverflow.com/questions/48362672/scenekit-how-to-recreate-lighting-from-google-poly-for-same-obj-file – Crashalot Feb 15 '18 at 10:11
  • 1
    Possible duplicate of [Mixed topology (quad/tri) with ModelIO](https://stackoverflow.com/questions/48179571/mixed-topology-quad-tri-with-modelio) – mnuages Feb 15 '18 at 13:56
  • Did you consider that OBJ file faces can contain non-convex flat polygons with many segments that need to be triangulated? – abenci Feb 16 '18 at 08:38

0 Answers0