great tutorial. Very cool.
I’m having an issue setting the background image.
scnScene.background.contents = “GeometryFighter.scnassets/Textures/Background_Diffuse.png”
displays a black image not blue. Please advise.
Same problem here. I resolved it by looking at the documentation for SCNScene. There is a Note saying “For best results, place scene files that ship in your app bundle in a folder with the .scnassets extension, and place image files referenced as textures from those scenes in an Asset Catalog…”
So - here’s what I did:
Open Assets.xcassets and then drag Background_Diffuse.png into the asset list.
Adjust the line in setupScene() so that it creates a new UIImage from that asset:
scnScene.background.contents = UIImage(named: “Background_Diffuse”)
Run the app. It should show the blue background now. This worked for me.
This tutorial is more than six months old, so questions regarding it are no longer supported for the moment. We will update it as soon as possible. Thank you! :]