Skip to content

Instantly share code, notes, and snippets.

@brunomunizaf
Last active August 22, 2018 13:24
Show Gist options
  • Save brunomunizaf/0bf3d250180a59138d53d9455c324404 to your computer and use it in GitHub Desktop.
Save brunomunizaf/0bf3d250180a59138d53d9455c324404 to your computer and use it in GitHub Desktop.
gesture recognizer
// MARK: - Private
extension ViewController {
@objc func tapped(recognizer: UIGestureRecognizer) {
guard let currentFrame = self.sceneView.session.currentFrame,
let url = URL(string: "https://www.supercharge.io") else {
return
}
webView.loadRequest(URLRequest(url: url))
let browserPlane = SCNPlane(width: 1.0, height: 0.75)
browserPlane.firstMaterial?.diffuse.contents = webView
browserPlane.firstMaterial?.isDoubleSided = true
let browserPlaneNode = SCNNode(geometry: browserPlane)
var translation = matrix_identity_float4x4
translation.columns.3.z = -1.0
browserPlaneNode.simdTransform = matrix_multiply(currentFrame.camera.transform, translation)
browserPlaneNode.eulerAngles = SCNVector3Zero
self.sceneView.scene.rootNode.addChildNode(browserPlaneNode)
}
private func loopCoreMLUpdate() {
serialQueue.async {
self.updateCoreML()
self.loopCoreMLUpdate()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment