Followers

Thursday 20 July 2017

Swift World: What’s new in iOS 11 — ARKit

Source: medium.com --- Thursday, July 20, 2017
In iOS 11, Apple will bring AR to iPhone. You should have seen some amazing examples if you follow Swift World This Week . In this article, we will build our own AR app. I will not flood your mind with different definitions in AR world. On the contrary, you only need a few lines of codes to create a real-world AR app. Let’s get started. There is a new template for Augmented Reality App in Xcode 11. In this template, there are already boilerplate codes and 3D model. We will reuse these materials. Please let me show the final result to make it clear what we want to build. One space ship is created and placed on airport with one tap. I will build my own flight team. Please create a new project with the template for Augmented Reality App. In art.scnassets, we will see the scn file and texture. Click ship.scn to preview this 3D model in SceneKit Editor. We will use this model. You can find many free 3D models on Internet. In the default root view controller, Xcode has created a ARSCNView with IBOutlet, new SCNScene with a 3D model and necessary setting. Keep them and what we need to do is simple. 1. Declare node for the 3D model 2. In ViewDidLoad, please assign the ship to node. You can find the name for ship node in Inspector of Scenekit editor. 3. Add tap gesture to scene view 4. Action for tap gesture, clone node and add it to the point we tap Build and pray. This is only the first step. We need to do more to make fantastic effects ...



from Apple http://ift.tt/2vmyHF3

No comments:

Post a Comment