This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.UI; | |
using UnityEngine.XR.ARFoundation; | |
using UnityEngine.XR.ARSubsystems; | |
namespace HelloWorld | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this to the top of your file | |
import PlacenoteSDK | |
// Initialize LibPlacenote in your application launch function like this | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: | |
[UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
LibPlacenote.instance.initialize(apiKey: "Enter API Key Here") | |
return true | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func viewDidLoad() { | |
super.viewDidLoad() | |
// configuration | |
LibPlacenote.instance.multiDelegate += self | |
// set up AR session | |
self.sceneView.session.run(configuration) | |
self.sceneView.autoenablesDefaultLighting = true | |
self.sceneView.debugOptions = [ARSCNDebugOptions.showFeaturePoints] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func renderSphere() { | |
let geometry:SCNGeometry = SCNSphere(radius: 0.05) //units, meters | |
let geometryNode = SCNNode(geometry: geometry) | |
geometryNode.position = SCNVector3(x:0.0, y:0.0, z:0.0) | |
geometryNode.geometry?.firstMaterial?.diffuse.contents = UIColor.green | |
sceneView.scene.rootNode.addChildNode(geometryNode) | |
} |