Skip to content

Instantly share code, notes, and snippets.

Created June 12, 2015 18:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
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