public override void SetupSlide(PresentationViewController presentationViewController) { // Add some text TextManager.SetTitle("Loading a 3D Scene"); TextManager.SetSubtitle("DAE Documents"); NodesToDim = new List <SCNNode> (); TextManager.AddBulletAtLevel("Geometries", 0); TextManager.AddBulletAtLevel("Animations", 0); NodesToDim.Add(TextManager.AddBulletAtLevel("Textures", 0)); NodesToDim.Add(TextManager.AddBulletAtLevel("Lighting", 0)); NodesToDim.Add(TextManager.AddBulletAtLevel("Cameras", 0)); NodesToDim.Add(TextManager.AddBulletAtLevel("Skinning", 0)); NodesToDim.Add(TextManager.AddBulletAtLevel("Morphing", 0)); // And an image resting on the ground DaeIcon = Utils.SCPlaneNode(NSBundle.MainBundle.PathForResource("Images/dae file icon", "png"), 10, false); DaeIcon.Position = new SCNVector3(6, 4.5f, 1); GroundNode.AddChildNode(DaeIcon); AbcIcon = Utils.SCPlaneNode(NSBundle.MainBundle.PathForResource("Images/abc file icon", "png"), 10, false); AbcIcon.Position = new SCNVector3(6, 4.5f, 30); GroundNode.AddChildNode(AbcIcon); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Particles"); TextManager.SetSubtitle("SCNParticleSystem"); TextManager.AddBulletAtLevel("Achieve a large number of effects", 0); TextManager.AddBulletAtLevel("3D particle editor built into Xcode", 0); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Creating a Scene"); TextManager.AddBulletAtLevel("Creating programmatically", 0); TextManager.AddBulletAtLevel("Loading a scene from a file", 0); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Scene Kit"); TextManager.SetSubtitle("Introduction"); TextManager.AddBulletAtLevel("High level API for 3D integration", 0); TextManager.AddBulletAtLevel("Data visualization", 1); TextManager.AddBulletAtLevel("User Interface", 1); TextManager.AddBulletAtLevel("Casual Games", 1); var redColor = NSColor.FromDeviceRgba(168.0f / 255.0f, 21.0f / 255.0f, 1.0f / 255.0f, 1); var grayColor = NSColor.Gray; var greenColor = NSColor.FromDeviceRgba(105.0f / 255.0f, 145.0f / 255.0f, 14.0f / 255.0f, 1); var orangeColor = NSColor.Orange; var purpleColor = NSColor.FromDeviceRgba(152.0f / 255.0f, 57.0f / 255.0f, 189.0f / 255.0f, 1); Boxes = new List <SCNNode> (); AddBox("Cocoa", new CGRect(0, 0, 500, 70), 3, grayColor); AddBox("Core Image", new CGRect(0, 0, 100, 70), 2, greenColor); AddBox("Core Animation", new CGRect(390, 0, 110, 70), 2, greenColor); AddBox("Sprite Kit", new CGRect(250, 0, 135, 70), 2, greenColor); AddBox("Scene Kit", new CGRect(105, 0, 140, 70), 2, orangeColor); AddBox("OpenGL / OpenGL ES", new CGRect(0, 0, 500, 70), 1, purpleColor); AddBox("Graphics Hardware", new CGRect(0, 0, 500, 70), 0, redColor); }
public override void PresentStep(int index, PresentationViewController presentationViewController) { switch (index) { case 0: // Set the slide's title // And make the bullets we will add later to fade in TextManager.SetTitle("Outline"); TextManager.FadesIn = true; break; case 1: TextManager.AddBulletAtLevel("Scene graph", 0); break; case 2: TextManager.AddBulletAtLevel("Build an application with Scene Kit", 0); break; case 3: TextManager.AddBulletAtLevel("Extending with OpenGL", 0); break; case 4: TextManager.AddBulletAtLevel("What’s new in OS X 10.9", 0); break; case 5: TextManager.AddBulletAtLevel("Performance notes", 0); break; } }
public override void SetupSlide(PresentationViewController presentationViewController) { // Set the slide's title and subtitle and add some text TextManager.SetTitle("Materials"); TextManager.SetSubtitle("Property contents"); TextManager.AddBulletAtLevel("Color", 0); TextManager.AddBulletAtLevel("CGColorRef / NSColor / UIColor", 0); var node = SCNNode.Create(); node.Name = "material-cube"; node.Geometry = SCNBox.Create(W, W, W, W * 0.02f); Material = node.Geometry.FirstMaterial; Material.Diffuse.Contents = NSColor.Red; Object = node; node.Position = new SCNVector3(8, 11, 0); ContentNode.AddChildNode(node); node.RunAction(SCNAction.RepeatActionForever(SCNAction.RotateBy((float)Math.PI * 2, new SCNVector3(0.4f, 1, 0), 4))); MaterialLayerSlideReference = this; }
public override void PresentStep(int index, PresentationViewController presentationViewController) { switch (index) { case 0: // Set the slide's title and subtile TextManager.SetTitle("Performance"); TextManager.SetSubtitle("Texturing"); // From now on, every text we add will fade in TextManager.FadesIn = true; break; case 1: TextManager.AddBulletAtLevel("Avoid unnecessarily large images", 0); break; case 2: TextManager.AddBulletAtLevel("Lock ambient and diffuse", 0); TextManager.AddCode("#aMaterial.#LocksAmbientWithDiffuse# = true;#"); break; case 3: TextManager.AddBulletAtLevel("Use mipmaps", 0); TextManager.AddCode("#aMaterial.Diffuse.#MipFilter# = #SCNFilterMode.Linear#;#"); break; } }
public override void PresentStep(int index, PresentationViewController presentationViewController) { switch (index) { case 0: // Set the slide's title and subtitle and add some text. TextManager.SetTitle("Performance"); TextManager.SetSubtitle("Flattening"); TextManager.AddBulletAtLevel("Flatten node tree into single node", 0); TextManager.AddBulletAtLevel("Minimize draw calls", 0); TextManager.AddCode("#// Flatten node hierarchy \n" + "var flattenedNode = aNode.#FlattenedClone# ();#"); break; case 1: // Discard the text and show a 2D image. // Animate the image's position when it appears. TextManager.FlipOutText(SlideTextManager.TextType.Code); TextManager.FlipOutText(SlideTextManager.TextType.Bullet); var imageNode = Utils.SCPlaneNode(NSBundle.MainBundle.PathForResource("Images/flattening", "png"), 20, false); imageNode.Position = new SCNVector3(0, 4.8f, 16); GroundNode.AddChildNode(imageNode); SCNTransaction.Begin(); SCNTransaction.AnimationDuration = 1; imageNode.Position = new SCNVector3(0, 4.8f, 8); SCNTransaction.Commit(); break; } }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Shader Modifiers"); TextManager.AddBulletAtLevel("Inject custom GLSL code", 0); TextManager.AddBulletAtLevel("Combines with Scene Kit’s shaders", 0); TextManager.AddBulletAtLevel("Inject at specific stages", 0); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Summary"); TextManager.AddBulletAtLevel("SceneKit available on iOS", 0); TextManager.AddBulletAtLevel("Casual game ready", 0); TextManager.AddBulletAtLevel("Full featured rendering", 0); TextManager.AddBulletAtLevel("Extendable", 0); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Scene Kit Editor"); TextManager.AddBulletAtLevel("Built into Xcode", 0); TextManager.AddBulletAtLevel("Scene graph inspection", 0); TextManager.AddBulletAtLevel("Rendering preview", 0); TextManager.AddBulletAtLevel("Adjust lightning and materials", 0); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("3D Particle Editor"); TextManager.AddBulletAtLevel("Integrated into Xcode", 0); TextManager.AddBulletAtLevel("Edit .scnp files", 0); TextManager.AddBulletAtLevel("Particle templates available", 0); }
public override void PresentStep(int index, PresentationViewController presentationViewController) { switch (index) { case 0: TextManager.SetTitle("Animation Events"); TextManager.AddBulletAtLevel("SCNAnimationEvent", 0); TextManager.AddBulletAtLevel("Smooth transitions", 0); TextManager.AddCode("#var anEvent = #SCNAnimationEvent.Create# (0.2, aBlock); \n" + "anAnimation.#AnimationEvents# = @[anEvent, anotherEvent];#"); var path = NSBundle.MainBundle.PathForResource("Sounds/bossaggro", "wav"); var soundUrl = NSUrl.FromFilename(path); var bossaggro = new NSSound(soundUrl, false); bossaggro.Play(); break; case 1: // Trigger the attack animation HeroSkeletonNode.AddAnimation(Animations [(int)CharacterAnimation.Attack], new NSString("attack")); break; case 2: TextManager.FadeOutText(SlideTextManager.TextType.Code); TextManager.AddCode("#\n" + "\n" + "\n\n" + "anAnimation.FadeInDuration = #0.0#;\n" + "anAnimation.FadeOutDuration = #0.0#;#"); break; case 3: case 4: Animations[(int)CharacterAnimation.Attack].FadeInDuration = 0; Animations[(int)CharacterAnimation.Attack].FadeOutDuration = 0; // Trigger the attack animation HeroSkeletonNode.AddAnimation(Animations [(int)CharacterAnimation.Attack], new NSString("attack")); break; case 5: TextManager.FadeOutText(SlideTextManager.TextType.Code); TextManager.AddCode("#\n" + "\n" + "\n\n" + "anAnimation.FadeInDuration = #0.3#;\n" + "anAnimation.FadeOutDuration = #0.3#;#"); break; case 6: case 7: Animations[(int)CharacterAnimation.Attack].FadeInDuration = 0.3f; Animations[(int)CharacterAnimation.Attack].FadeOutDuration = 0.3f; // Trigger the attack animation HeroSkeletonNode.AddAnimation(Animations [(int)CharacterAnimation.Attack], new NSString("attack")); break; } }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Extending Scene Kit with OpenGL"); TextManager.SetSubtitle("Scene delegate rendering"); TextManager.AddBulletAtLevel("Custom GL code, free of constraints", 0); TextManager.AddBulletAtLevel("Before and/or after scene rendering", 0); TextManager.AddBulletAtLevel("Works with SCNView, SCNLayer and SCNRenderer", 0); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Extending Scene Kit with OpenGL"); TextManager.AddBulletAtLevel("Scene delegate rendering", 0); TextManager.AddBulletAtLevel("Node delegate rendering", 0); TextManager.AddBulletAtLevel("Material custom program", 0); TextManager.AddBulletAtLevel("Shader modifiers", 0); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Actions"); TextManager.SetSubtitle("SCNAction"); TextManager.AddBulletAtLevel("Easy to sequence, group and repeat", 0); TextManager.AddBulletAtLevel("Limited to SCNNode", 0); TextManager.AddBulletAtLevel("Same programming model as SpriteKit", 0); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Scene Manipulation"); TextManager.SetSubtitle("Animations"); TextManager.AddBulletAtLevel("Properties are animatable", 0); TextManager.AddBulletAtLevel("Implicit and explicit animations", 0); TextManager.AddBulletAtLevel("Same programming model as Core Animation", 0); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Rendering a Scene"); TextManager.AddBulletAtLevel("Assign the scene to the renderer", 0); TextManager.AddBulletAtLevel("Modifications of the scene graph are automatically reflected", 0); TextManager.AddCode("#// Assign the scene \nSCNView.#Scene# = aScene;#"); }
public override void PresentStep(int index, PresentationViewController presentationViewController) { SCNTransaction.Begin(); switch (index) { case 0: // Set the slide's title and subtitle and add some text TextManager.SetTitle("Skinning"); TextManager.AddBulletAtLevel("Animate characters", 0); TextManager.AddBulletAtLevel("Deform geometries with a skeleton", 0); TextManager.AddBulletAtLevel("Joints and bones", 0); // Animate the character CharacterNode.AddAnimation(IdleAnimationGroup, new NSString("idleAnimation")); // The character is hidden. Wait a little longer before showing it // otherwise it may slow down the transition from the previous slide var delayInSeconds = 1.5; var popTime = new DispatchTime(DispatchTime.Now, (long)(delayInSeconds * Utils.NSEC_PER_SEC)); DispatchQueue.MainQueue.DispatchAfter(popTime, () => { SCNTransaction.Begin(); SCNTransaction.AnimationDuration = 0; CharacterNode.Hidden = false; CharacterNode.Opacity = 0; SCNTransaction.Commit(); SCNTransaction.Begin(); SCNTransaction.AnimationDuration = 1.5; SCNTransaction.AnimationTimingFunction = CAMediaTimingFunction.FromName(CAMediaTimingFunction.EaseIn); CharacterNode.Opacity = 1; SCNTransaction.Commit(); }); break; case 1: SCNTransaction.AnimationDuration = 1.5f; //TODO SetShowsBones (true); break; case 2: CharacterNode.AddAnimation(AnimationGroup1, new NSString("animation")); break; case 3: SCNTransaction.AnimationDuration = 1.5f; //TODO SetShowsBones (false); break; case 4: CharacterNode.AddAnimation(AnimationGroup1, new NSString("animation")); break; } SCNTransaction.Commit(); }
public override void PresentStep(int index, PresentationViewController presentationViewController) { SCNTransaction.Begin(); SCNTransaction.AnimationDuration = 0; switch (index) { case 0: // Set the slide's title and subtile and add some text TextManager.SetTitle("Node Attributes"); TextManager.SetSubtitle("Lights"); TextManager.AddBulletAtLevel("SCNLight", 0); TextManager.AddBulletAtLevel("Four light types", 0); TextManager.AddBulletAtLevel("Omni", 1); TextManager.AddBulletAtLevel("Directional", 1); TextManager.AddBulletAtLevel("Spot", 1); TextManager.AddBulletAtLevel("Ambient", 1); break; case 1: // Add some code var codeExampleNode = TextManager.AddCode("#aNode.#Light# = SCNLight.Create (); \naNode.Light.LightType = SCNLightType.Omni;#"); codeExampleNode.Position = new SCNVector3(14, 11, 1); // Add a light to the scene LightNode = SCNNode.Create(); LightNode.Light = SCNLight.Create(); LightNode.Light.LightType = SCNLightType.Omni; LightNode.Light.Color = NSColor.Black; // initially off LightNode.Light.SetAttribute(new NSNumber(30), SCNLightAttribute.AttenuationStartKey); LightNode.Light.SetAttribute(new NSNumber(40), SCNLightAttribute.AttenuationEndKey); LightNode.Position = new SCNVector3(5, 3.5f, 0); ContentNode.AddChildNode(LightNode); // Load two images to help visualize the light (on and off) LightOffImageNode = Utils.SCPlaneNode(NSBundle.MainBundle.PathForResource("Images/light-off", "tiff"), 7, false); LightOnImageNode = Utils.SCPlaneNode(NSBundle.MainBundle.PathForResource("Images/light-on", "tiff"), 7, false); LightOnImageNode.Opacity = 0; LightNode.AddChildNode(LightOnImageNode); LightNode.AddChildNode(LightOffImageNode); break; case 2: // Switch the light on SCNTransaction.Begin(); SCNTransaction.AnimationDuration = 1; LightNode.Light.Color = NSColor.FromCalibratedRgba(1, 1, 0.8f, 1); LightOnImageNode.Opacity = 1.0f; LightOffImageNode.Opacity = 0.0f; SCNTransaction.Commit(); break; } SCNTransaction.Commit(); }
public override void SetupSlide(PresentationViewController presentationViewController) { // Set the slide's title and subtitle and add some text TextManager.SetTitle("Performance"); TextManager.SetSubtitle("Lighting"); TextManager.AddBulletAtLevel("Minimize the number of lights", 0); TextManager.AddBulletAtLevel("Prefer static than dynamic shadows", 0); TextManager.AddBulletAtLevel("Use material's \"multiply\" property", 0); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Multi-Pass Effects"); TextManager.SetSubtitle("SCNTechnique"); TextManager.AddBulletAtLevel("Multi-pass effects", 0); TextManager.AddBulletAtLevel("Post processing", 0); TextManager.AddBulletAtLevel("Chain passes", 0); TextManager.AddBulletAtLevel("Set and animate shader uniforms from C#", 0); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Outline"); TextManager.AddBulletAtLevel("Scene graph overview", 0); TextManager.AddBulletAtLevel("Getting started", 0); TextManager.AddBulletAtLevel("Animating", 0); TextManager.AddBulletAtLevel("Rendering", 0); TextManager.AddBulletAtLevel("Effects", 0); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Animating a Scene"); TextManager.SetSubtitle("Outline"); TextManager.AddBulletAtLevel("Per-Frame Updates", 0); TextManager.AddBulletAtLevel("Animations", 0); TextManager.AddBulletAtLevel("Actions", 0); TextManager.AddBulletAtLevel("Physics", 0); TextManager.AddBulletAtLevel("Constraints", 0); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Shader Modifiers"); TextManager.AddBulletAtLevel("Inject custom GLSL code", 0); TextManager.AddBulletAtLevel("Combines with Scene Kit’s shaders", 0); TextManager.AddBulletAtLevel("Inject at specific stages", 0); TextManager.AddEmptyLine(); TextManager.AddCode("#aMaterial.#shaderModifiers# = @{ <Entry Point> : <GLSL Code> };#"); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Scene Manipulation"); TextManager.SetSubtitle("Basics"); TextManager.AddBulletAtLevel("Retrieve nodes", 0); TextManager.AddBulletAtLevel("Move, scale and rotate", 0); TextManager.AddBulletAtLevel("Animate", 0); TextManager.AddBulletAtLevel("Change colors and images", 0); TextManager.AddBulletAtLevel("Change lighting", 0); TextManager.AddBulletAtLevel("Clone", 0); }
public override void SetupSlide(PresentationViewController presentationViewController) { TextManager.SetTitle("Shadows"); TextManager.AddBulletAtLevel("Static", 0); TextManager.AddBulletAtLevel("Dynamic", 0); TextManager.AddBulletAtLevel("Projected", 0); var sceneryHolder = SCNNode.Create(); sceneryHolder.Name = "scenery"; sceneryHolder.Position = new SCNVector3(5, -19, 12); GroundNode.AddChildNode(sceneryHolder); //add scenery var scenery = Utils.SCAddChildNode(sceneryHolder, "scenery", "Scenes.scnassets/banana/level", 130); scenery.Position = new SCNVector3(-291.374969f, 1.065581f, -30.519293f); scenery.Scale = new SCNVector3(0.044634f, 0.044634f, 0.044634f); scenery.Rotation = new SCNVector4(1, 0, 0, -NMath.PI / 2); PalmTree = Utils.SCAddChildNode(GroundNode, "PalmTree", "Scenes.scnassets/palmTree/palm_tree", 15); PalmTree.Position = new SCNVector3(3, -1, 7); PalmTree.Rotation = new SCNVector4(1, 0, 0, -NMath.PI / 2); foreach (var child in PalmTree.ChildNodes) { child.CastsShadow = false; } //add a static shadow var shadowPlane = SCNNode.FromGeometry(SCNPlane.Create(15, 15)); shadowPlane.EulerAngles = new SCNVector3(-NMath.PI / 2, (float)(Math.PI / 4) * 0.5f, 0); shadowPlane.Position = new SCNVector3(0.5f, 0.1f, 2); shadowPlane.Geometry.FirstMaterial.Diffuse.Contents = new NSImage(NSBundle.MainBundle.PathForResource("Images/staticShadow", "tiff")); GroundNode.AddChildNode(shadowPlane); StaticShadowNode = shadowPlane; StaticShadowNode.Opacity = 0; var character = Utils.SCAddChildNode(GroundNode, "explorer", "Scenes.scnassets/explorer/explorer_skinned", 9); var animScene = SCNScene.FromFile("Scenes.scnassets/explorer/idle"); var animatedNode = animScene.RootNode.FindChildNode("Bip001_Pelvis", true); character.AddAnimation(animatedNode.GetAnimation(animatedNode.GetAnimationKeys() [0]), new NSString("idle")); character.EulerAngles = new SCNVector3(0, NMath.PI / 2, NMath.PI / 2); character.Position = new SCNVector3(20, 0, 7); Character = character; }
public override void SetupSlide(PresentationViewController presentationViewController) { // Set the slide's title and subtitle and add some text TextManager.SetTitle("Scene Graph"); TextManager.SetSubtitle("Scene"); TextManager.AddBulletAtLevel("SCNScene", 0); TextManager.AddBulletAtLevel("Starting point", 0); // Setup the diagram var diagramNode = SlideSceneGraph.SharedScenegraphDiagramNode(); GroundNode.AddChildNode(diagramNode); }
public override void SetupSlide(PresentationViewController presentationViewController) { // Set the slide's title and subtitle and add some code TextManager.SetTitle("Scriptability"); TextManager.AddBulletAtLevel("Javascript bridge", 0); TextManager.AddCode("#// setup a JSContext for SceneKit\n" + "#SCNJavaScript.ExportModule# (aJSContext);\n\n" + "// reference a SceneKit object from JS\n" + "aJSContext.#GlobalObject# = aNode;\n\n" + "// execute a script\n" + "aJSContext.#EvaluateScript# (\"aNode.scale = {x:2, y:2, z:2};\");#"); }
public override void PresentStep(int index, PresentationViewController presentationViewController) { TextManager.SetTitle("Creating a Scene"); TextManager.AddBulletAtLevel("Creating programmatically", 0); TextManager.AddBulletAtLevel("Loading a scene from a file", 0); var delayInSeconds = 1.0; var popTime = new DispatchTime(DispatchTime.Now, (long)(delayInSeconds * Utils.NSEC_PER_SEC)); DispatchQueue.MainQueue.DispatchAfter(popTime, () => { TextManager.HighlightBullet(1); }); }