Apple ARKit, first steps with Reality Composer

How I expect breakfast or lunch to be with friends in 2030

Hannah Schieber
5 min readSep 27, 2020

Thinking about our future life is something mankind has done for decades. Many Sci-Fi movies have shown us how some of us expect the future and how the interaction between humans changes. The year 2020 really made me think about ways to interact with people without meeting them.

What I missed most this year was going out for breakfast or lunch with friends on the weekend. Of course not being at high risk from the coronavirus it is now possible to do this again, but still it is not the same as before.

We adapted to changes during this year and I also think that even if someone finds a vaccine against Corona the world would still be different. So why not thinking ahead of the current situation.

Many video platforms to call friends already exist. During the beginning of the corona crisis earlier this year even some party apps for video calling were developed. But I think it would be more fun to really interact with someone a bit more then just on a video camera.

© by Hannah Schieber

Focusing on the technology which is available for us at the moment Augmented Reality (AR) would be a possible solution for that. Objects can be virtually placed in the real world.

One of the best known examples is the Apple ARKit. The Apple ARKit is an API from Apple that can be used in conjunction with the Swift programming language. The Apple ARKit is used to access the camera of the iPhone or iPad to capture the real world. Virtual objects are placed within the camera image, while the image of the environment is represented.

”AR is going to take a while, because there are some really hard technology challenges there. But it will happen, it will happen in a big way, and we will wonder when it does, how we ever lived without it. Like we wonder how we lived without our phone today.”

Tim Cook, Apple CEO

At the World Wide Development Conference of 2019, Apple introduced the Reality Composer. The following article will describe how to do the first steps in the Reality Composer.

Reality Composer

Is an application developed by apple which makes it possible to prototype AR-Scenes and export them to use them in your Swift Application.

Basic Reality Composer View

Just download the Reality Composer from the AppStore with your iPhone or iPad or directly interact via Xcode with the Reality Composer on your Mac. I decided to go with the iPad Version.

The first view on Reality Composer looks like that:

Get familiar with the manipulation tools on the right side. The next step is to think about what you want to prototype in the Reality Composer. Out of the box it offers a few objects, some of them will be used in the following example. As most computer scientist love coffee I decided to create a coffee mug.

Mug Prototype

Think about the geometric/scene objects your prototype consists of. In my case it was:

  • two cylinders (one for the mug and one for the coffee)
  • two torus (for the top of the mug)
  • and something that looks like slug or snake
Mug without coffee
Mug with coffee

After that I decided to also add some predefined objects from the Content Library:

After finishing the scene the next step is to see how the objects look in the real world. This can be done directly in the Reality Composer by clicking the AR-Button in the top right hand corner:

Reality Composer, real world placement

If the current design of your objects is fine, the next step is to integrate them into a Swift Project. In the following the integration of the objects into a Swift Project will be shown.

For further interaction with the objects inside a mobile application there are already many tutorials available. For example one from Apple (Apple ARKit examples) explaining how to manipulate the position of the virtual objects and also defining where the place them.

Reality Composer and Swift

Create a new swift project. Either select Single View App or Augmented Reality App. If you want to add more functionality to your application choose Single View App (ARViews can be added later in the development process). For the basic example just select Augmented Reality App.

Drag and drop your newly created Reality Composer Project inside your Application.

For the correct loading of the Reality Composer View the code in ContentView.swift has to be adapted:

Conclusion

Thinking beyond this basic example, how cool would it be to get a virtual breakfast or lunch with your family or friends. Them and their food would be displayed and the interaction would be way more real than the current solution with the video calls.

--

--

Hannah Schieber

Computer Science Student, Frontend and Computer Vision Enthusiast