December 2019
Intermediate to advanced
388 pages
8h 11m
English
The main trick of an AR portal is based on two things: the transparency and the rendering order. We are going to create a wall with an opening (we will call it the door) in the middle, through which we will see the 3D painting. Open the Portal.swift file and follow these steps:
func createWall(width: CGFloat, height: CGFloat, length: CGFloat)->SCNNode { let node = SCNNode() let wall = SCNBox(width: width, height: height, length: length, chamferRadius: 0) wall.firstMaterial?.diffuse.contents = UIColor.white let wallNode = SCNNode(geometry: wall) node.addChildNode(wallNode) return node}
Here, we created a parent node. Then, we created a box with ...
Read now
Unlock full access