September 2018
Intermediate to advanced
434 pages
8h 47m
English
Although the game is done, we can see that the plane is completely covering the scene and breaking the AR experience. We will disable the rendering of the floor and make sure that only the shadow is preserved so that it looks like part of the real world.
To do this, after creating the floor, set the colorBufferWriteMask value to 0 as follows:
let ground = SCNFloor()
ground.firstMaterial?.diffuse.contents = UIColor.gray
ground.firstMaterial?.colorBufferWriteMask = .init(rawValue: 0)
We don't need the debug information anymore, so we can comment out the debugOption line in the viewDidLoad function:
//sceneView.debugOptions = [ARSCNDebugOptions.showWorldOrigin, // ARSCNDebugOptions.showFeaturePoints, // SCNDebugOptions.showPhysicsShapes] ...
Read now
Unlock full access