Skip to content

Instantly share code, notes, and snippets.

@rdelrosario
Last active January 18, 2018 03:50
Show Gist options
  • Save rdelrosario/1d5047c02733bca9914b7cc988a7e423 to your computer and use it in GitHub Desktop.
Save rdelrosario/1d5047c02733bca9914b7cc988a7e423 to your computer and use it in GitHub Desktop.
ARKitSample - Pokemon - ViewWillAppear
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