I have a bunch of SCNNode's that all share the same parent. I can rotate a group them around their own axes using
func handleTap(gestureRecognize: UIGestureRecognizer) {
let sceneView = self.view as SCNView
let action = SCNAction.rotateByAngle(CGFloat(M_PI_2), aroundAxis: SCNVector3Make(-1, 0, 0), duration: 1)
let slice = self.cubes[18...26]
for node: SCNNode in slice {
node.runAction(action, completionHandler: { () -> Void in
println("hmm")
})
}
}
But ideally what I would like to do is rotate them around their parent's axis instead. I can rotate the entire parent but that rotates many more nodes than I'd like, and I've tried grouping them into their own parent, but when I add them back to their previous parent they don't maintain their new position.