Please conduct the following tasks. For implementation details you can refer to the lecture slides or the Apple ARKit documentation website. Please do not hesitate to ask me if you have any questions. Under „Tip“ you can find some hints for the task. The „Checklist“ specifies what should happen when your implementation is correct.
In this assignment, please start with an empty app based on the “Single View App” template. After creating the app, add a ARSCNView as the only view to your ViewController in the Main.storyboard.
The result should look something like this:
Next, conduct the following steps and implement the plane detection and rendering of planes in the scene. Use the ARKit introduction slides for reference and code examples.
Checklist | Check? |
---|---|
The app runs showing detected planes. | ☑️ |
In order to detect touches you can override the method:
touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?)
Within that method use the hitTest()
method of the ARSCNView to get the location where the user touched a plane.
Create a new SCNnode and position it on that location.
You can either model your own 3D model in the Scene editor or load an existing model from a USDZ file.
The result should look something like this:
Checklist | Check? |
---|---|
The AR models can be added to the scene when touching a detected plane | ☑️ |