08/20/2020
When Apple introduced ARKit in 2017, they really raised the bar for augmented reality software development tools. Each year, additional capabilities were introduced at WWDC (Worldwide developer conference) to further enhance the capabilities. As of 2020, ARKit provides a very rich set of tools needed to render scenes with virtual objects including positioning them in the scene as viewed by the camera. ARKit includes tools to with powerful World Tracking, Scene Understanding, and Rendering capabilities.��World Tracking uses a concept called Sensor Fusion. As the name implies, Sensor Fusion melds data from various sensors together including vision based inertial navigation and triangulation. What would otherwise be an extremely complex undertaking, is made very accessible with a single code directive. All the developer has to do is make a call to a function called « ARWorldTrackingConfiguration() ». Once that’s done, iOS starts tracking the device location, orientation and movement using data from multiple sensors.
Scene Understanding is equally complex and combines Computer Vision, Plane Detection, Hit Testing. Surface Estimation, Feature Detection, and Feature Matching. For example, a developer can specify horizontal plane detection if detecting a table-top is desired. Hit Testing can then be used to determine if a virtual object is resting on the table-top.
Rendering creates and places your virtual object into the scene. In the last iOS Workshop we rendered a scaled down version of the Solar System, by rendering the Sun, Earth and Moon and animating the orbits or the Earth and Moon around the Sun. We used open-source textures for each celestial object’s appearance and ARKit provides easy access to set those properties. The « SCNNode » object gets created with a single line of code, and the SCNGeometry property is used to create spheres. We then position the nodes (Sun, Earth etc) and with two more lines of code, set them in orbit around the Sun.
It’s extraordinary what can be accomplished with so little code. And with the added capabilities each year since 2017, we look forward to WWDC 2021. In the meantime, why not join the free iOS Workshop on Meetup and see what you too can accomplish?