© Wallace Wang 2018
Wallace WangBeginning ARKit for iPhone and iPadhttps://doi.org/10.1007/978-1-4842-4102-8_11

11. Plane Detection

Wallace Wang1 
(1)
San Diego, CA, USA
 

Placing virtual objects in mid-air is fine, but augmented reality works best when it also interacts with the real world. One of the most basic ways augmented reality interacts with the real world is through detecting horizontal or vertical planes. When ARKit can detect a flat surface, it can later place a virtual object so that it appears to be resting on that real flat surface, such as a table or floor.

Each time ARKit detects a plane, it places an anchor in that augmented reality view. This anchor, one per plane, contains information about the plane’s:
  • Orientation

  • Position

  • Size

As you ...

Get Beginning ARKit for iPhone and iPad: Augmented Reality App Development for iOS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.