Chapters

Hide chapters

Apple Augmented Reality by Tutorials

First Edition · iOS 14 · Swift 5.1 · Xcode 12

Before You Begin

Section 0: 3 chapters
Show chapters Hide chapters

Section I: Reality Composer

Section 1: 5 chapters
Show chapters Hide chapters

3. Reality Composer & Reality Files
Written by Chris Language

Heads up... You're reading this book for free, with parts of this chapter shown beyond this point as scrambled text.

Now that you know all about AR Quick Look, it’s time to dip your toes a little deeper into the shallow end of Augmented Reality (AR). In this chapter, you’ll learn about Reality Composer and Reality Files.

Until recently, creating immersive AR experiences was a somewhat difficult task. AR developers required a vast amount of skill, as well as knowledge of a wide variety of technologies, just to make a little cube appear in AR. That all changed when Apple announced Reality Composer.

What is Reality Composer?

Reality Composer is an AR authoring tool that lets you create interactive AR-based experiences with an intuitive WYSIWYG (What You See Is What You Get) design. It’s self-explanatory and super easy to use. You don’t need any prior coding or 3D development experience to use it.

Any AR Quick Look-compatible app, including iMessage, Safari, Files and even apps you build yourself, can then view the AR experiences you create.

Reality Composer is fully integrated into Xcode, which allows you to easily extend and customize your app’s AR experiences with the power of Xcode and Swift.

If you’re using an iPhone or iPad, you can download and install Reality Composer directly from the App Store using this link: https://apple.co/2RfDvt3

Reality Composer on an iPhone:

Although the interface is extremely compact, the app itself is fully functional, keeping you productive while you’re on the go. The best part of using an iPhone is that it allows you to edit your 3D scenes directly in AR space. You experience the end result first hand – no more playing in the dark!

Reality Composer on an iPad:

The iPad’s interface is similar to the iPhone’s interface, but with a little more breathing room.

There’s also a macOS version that installs automatically with the latest versions of Xcode.

Reality Composer on macOS:

You’ll notice subtle interface differences between the iPhone, iPad and macOS versions, but rest assured that the underlying functionality is exactly the same. However, the macOS version doesn’t allow editing in AR space, mainly due to the lack of a rear-facing camera on most Macs.

Overall, Apple did a fantastic job at delivering an experience across multiple platforms that is consistent and pleasant.

Note: At the time of writing, you can only install Reality Composer for macOS through Xcode. There’s no App Store version available for download yet.

Reality Composer features

Out of the box, Reality Composer is quite impressive and includes the following features:

Reality Composer’s limitations

Reality Composer is not perfect, and there are some limitations you need to understand before you make it your first choice for creating AR experiences. Here are a few important things to keep in mind:

Creating Reality Composer projects

With the basics out of the way, it’s time to get those hands dirty and create your first AR experience with Reality Composer. To create a new project, all you need to do is start Reality Composer.

Exploring the UI

With the HelloRealityKit project open, you’re ready to explore the User Interface (UI).

Adding scenes

Your project can contain more than one scene. Adding a new scene is as easy as clicking the + button in the top-right corner of the Scenes panel on the left. You could also use the Main menu by going to Scene ▸ Add Scene….

Navigating scenes

To navigate around the scene, you can manipulate the view in three ways: Zoom, Pan and Rotate.

Adding objects

An empty scene isn’t that exciting, so your next step is to spruce things up a bit by adding some objects to it.

Adjusting object transforms

With the 3D cube still selected, adjust its transform, which consists of three components: position, rotation and scale.

Adjusting object properties

With the cube still selected, open the Properties panel by clicking the Properties button in the toolbar.

Adjusting parametric properties

The cube you’ve added to the scene is a special object known as a parametric-shaped object. This means you can change the look of the object by adjusting its parameters.

Enabling physics

Reality Composer comes with an easy-to-use but powerful built-in physics simulator. Adding basic animation to your virtual objects elevates the believability of any AR scene.

Motion Type

There are two options for Motion Type, which determines how the object will participate in the physics simulation:

Physics Material

Your next step is to set up the Physics Material of the object. Reality Composer provides a few pre-configured material types.

Physics Collision Shape

Up next is setting the object’s Physics Collision Shape, which defines a rough shape for the object using the least amount of geometry possible. This reduces the overhead the physics engine has to deal with when computing collisions between multiple objects.

Playing scenes

Reality Composer has the ability to play the AR scene so that you can test it to find and debug any possible issues.

What are Reality files?

Reality Files contain an AR experience created with Reality Composer. They’re archives that contain all of the required graphics, animations, textures and sounds that the AR scene requires. You can share the file and play it back on any app that supports AR Quick Look.

Exporting and sharing Reality files

To share your AR experience, you first have to export it.

Key points

Congratulations! You’ve reached the end of this chapter. Consider yourself now one full toe deep into the fantastic world of augmented reality. :]

Have a technical question? Want to report a bug? You can ask questions and report bugs to the book authors in our official book forum here.
© 2024 Kodeco Inc.

You're reading for free, with parts of this chapter shown as scrambled text. Unlock this book, and our entire catalogue of books and videos, with a Kodeco Personal Plan.

Unlock now