Augmented reality is a term we’ve all heard of, but few developers are able to create immersive AR experiences — it often requires 3D design skills that are often missed in software development courses.

Thankfully, Apple’s Reality Composer makes it easy to build quick, immersive experiences without having experience with CAD and 3D modeling. While beginners can start with this tutorial, I strongly recommend checking out my previous tutorial for a more basic look at Reality Composer.

Adding Earth and the Moon

By now, you should have opened and created a Reality Composer project, and you’ll see a cube appear at the center of your canvas. Let’s remove the cube and move the Earth and the Moon to the center of the canvas instead.

Delete Boilerplate Objects

The first step, of course, is to remove the cube and any other boilerplate objects that Reality Composer has added for you. We’ll be starting afresh, so we don’t need these for our AR experience.

A boilerplate cube which needs to be removed.

To ensure you’ve gotten rid of everything, use Command + A to select all the objects in the scene and hit Delete to remove them all. Now, you should see a blank canvas — you’re all set to add Earth!

Import USDZ Files

In the past, you would have had to create your own 3D model for Earth, but after the introduction of USDZ, many mainstream sources have adopted the technology. One of these is NASA, which provides planets in the USDZ file format for you to use out-of-the-box — how exciting!

An example of a 3D model on NASA’s website.

Go ahead and download the Earth model and Moon model from NASA’s website. If you’d like to explore them beforehand, you can rotate and scale them within the browser as well.

Insert Models into Reality Composer

Since USDZ is Apple’s own 3D file format, Reality Composer includes excellent integration with USDZ files. This makes importing the models from NASA’s website quick and easy.

Using Reality Composer’s USDZ support to import models.

Once you’ve imported your images, you’ll need to zoom out a little bit to see the objects you’ve just added; they’re bigger than the scale of the canvas. When you zoom out, you’ll see something like this:

The Earth and the Moon patiently waiting for something to happen.

Great! You’ve now successfully downloaded and imported the two USDZ files into your Reality Composer project, and you’re ready for the next step — making them behave like actual planets.

#heartbeat #wwdc #reality-composer #ios #augmented-reality

Apple’s Reality Composer: Put the Moon in Orbit with Augmented Reality
9.55 GEEK