How to avoid roll in SceneKit camera controlled by Core Motion?
I'm setting my SceneKit camera to the current CMDeviceMotion attitude using the CMDeviceMotion extension described in this answer : func deviceDidMove(motion: CMDeviceMotion?, error: NSError?) { if let motion = motion { let orientation = motion.gaze(atOrientation: UIApplication.sharedApplication().statusBarOrientation) cameraNode.orientation = orientation } } This works beautifully, however, I'd like to block the rotation (roll) and only allow the camera to turn around (yaw) and pitch. I tried to convert the quaternion back to Euler angles and simply leave roll at 0: cameraNode.eulerAngles =