Last active
January 18, 2018 03:50
-
-
Save rdelrosario/1d5047c02733bca9914b7cc988a7e423 to your computer and use it in GitHub Desktop.
ARKitSample - Pokemon - ViewWillAppear
This file contains hidden or 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
public override void ViewWillAppear(bool animated) | |
{ | |
base.ViewWillAppear(animated); | |
// Create a session configuration | |
var configuration = new ARWorldTrackingConfiguration { | |
PlaneDetection = ARPlaneDetection.Horizontal, | |
LightEstimationEnabled = true | |
}; | |
SceneView.DebugOptions = ARSCNDebugOptions.ShowFeaturePoints | ARSCNDebugOptions.ShowWorldOrigin; | |
// Run the view's session | |
SceneView.Session.Run(configuration, ARSessionRunOptions.ResetTracking); | |
SceneView.Scene.RootNode.AddChildNode(CreatePokemonNodeFromFile("art.scnassets/Charizard.scn", "charizard", new SCNVector3(2f, -2f, -9f))); | |
SceneView.Scene.RootNode.AddChildNode(CreatePokemonNodeFromFile("art.scnassets/Pikachu.scn", "pikachu", new SCNVector3(8f, -1f, -6f))); | |
SceneView.Scene.RootNode.AddChildNode(CreatePokemonNodeFromFile("art.scnassets/Bulbasaur.scn", "bulbasaur", new SCNVector3(2f, -2f, 9f))); | |
SceneView.Scene.RootNode.AddChildNode(CreatePokemonNodeFromFile("art.scnassets/Scyther.scn", "scyther", new SCNVector3(8f, -1f, 6f))); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment