Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mikebluestein
Created June 12, 2015 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikebluestein/0c839995aa13355bb5d3 to your computer and use it in GitHub Desktop.
Save mikebluestein/0c839995aa13355bb5d3 to your computer and use it in GitHub Desktop.
simple example showing how to load a Collada file in Scene Kit using Xamarin.iOS
SCNScene scene;
SCNView sceneView;
SCNCamera camera;
SCNNode cameraNode;

public override void ViewDidLoad ()
{
	scene = SCNScene.FromFile ("duck", "ColladaModels.scnassets", new SCNSceneLoadingOptions ());

	sceneView = new SCNView (UIScreen.MainScreen.Bounds);
	sceneView.AutoresizingMask = UIViewAutoresizing.All;    
	sceneView.Scene = scene;

	camera = new SCNCamera { XFov = 40, YFov = 40 };
	cameraNode = new SCNNode { Camera = camera, Position = new SCNVector3 (0, 0, 40) };
	scene.RootNode.AddChildNode (cameraNode);

	View.AddSubview (sceneView);
}	
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment