Hello,
Can anyone say when there might be updates to the book & the chapters that have not been distributed so far?
I am quite keen to see more in depth examples of using SceneKit with ARKit.
I have been seeing some inconsistent results with using SCNActions with AR Kit. I don’t know if it my code or ARKit.
I have been trying to create some action sequences like the following:
let fadeInAction = SCNAction.fadeIn(duration: 2.0)
let fadeOutAction = SCNAction.fadeOut(duration: 1.5)
let action = SCNAction.moveBy(x: 0, y: -0.4, z: 0, duration: 3)
let rotate = SCNAction.repeatForever(SCNAction.rotate(by: .pi, around: SCNVector3(0, 0, 1), duration: 3))
let group = SCNAction.group([action, rotate])
// I saw online that some people where reporting that removeFromParentNode does not work if the node
// has a material reference
let blockAction = SCNAction.run { (node) in
node.geometry?.firstMaterial!.diffuse.contents = nil
}
let sequence = SCNAction.sequence([fadeInAction, group, fadeOutAction, blockAction, SCNAction.removeFromParentNode()])
The sequence as is does not work:
- there is no fade in or fade out
- there is no rotation
- the node does not get removed
If I reduce the sequence to just the move & removeFromParentNode it works.