Skip to content

Instantly share code, notes, and snippets.

Embed
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
You can’t perform that action at this time.