3
votes

I grabbed a simple pool table made in Blender from the web, exported it to dae format, added it into a scene by dragging the file and dropping it into the scene editor. The pool table shows fine there, however, when testing it on device/sim the model isn't visible and I just get a black screen. I can confirm it's something related to that model since I created a sphere from the primitive shapes in scene editor and that shows up fine. Also somehow the 3D model is there because the sphere sits on top of it. The sphere has a rigid body setup and its affected by gravity and it doesn't fall because of the pool table.

3

3 Answers

4
votes

Dragging the dae file into the .scnassets folder, converting it to .scn by using the built-in converter and then dragging the resulting file into the main scene file fixed the issue.

0
votes

Check the normals of your object. Since SceneKit always culls backfaces, it won't show faces whose normals are pointing inwards. You can fix them in Blender by going into Edit Mode, selecting everything with A, and pressing Ctrl + N. If it still doesn't work, then it is possible something is wrong with the exporter and you'll have to examine the normals of the .dae file with a different program.

0
votes

I had the same problem when I dragged and dropped a .obj file into XCode (into the scene.scnassets folder). The model would appear in the scene editor but wouldn't be there at runtime (on the simulator or on a device).

Solved the problem by adding the .obj file to the scene.scnassets folder in Finder, rather than XCode. The file then appears in XCode (refreshes automatically). I then selected the .obj file within XCode and clicked Editor > Convert to .scn file.

The texture will not be there, so you need to do the same process of copying the .png file into the scene.scnassets folder in Finder, and then dragging and dropping the .png file onto the Diffuse property.