ARKit, SceneKit, and How to Control the World
In Part 1 of this series, we went through a workflow where we processed a 3D model, created an AR project in Xcode, started an AR session and put our model in our augmented scene.
In this post, we’ll begin putting our model in action, using a variety of SceneKit methods, and begin interacting with the objects in our world.
The project for this post can be found at https://github.com/AbovegroundDan/ARTutorial_Part2
SceneKit Actions
SceneKit provides a set of actions that can be applied to a node. These actions can be used to animate movement, rotation, scaling and other node properties. They can be grouped to run at the same time, sequenced to run one after another, and repeated or reversed. The full list can be found at https://developer.apple.com/documentation/scenekit/scnaction
We’re going to continue modifying the current project, and start adding some actions to our object. Let’s begin by adding a rotation to our sphere.
After the addSphere method in our HoverScene, add the following method:
In this code, we create an action that describes a 180 degree rotation around the Y axis. This rotation should take…