RealityKit Basics: Where is the Origin?

Windows, Volumes, and Spaces each have an origin for 3D content.

The Origin (sometimes called the point of origin) is the point in a coordinate space where the values for each axis are 0.

Let’s start with the easy one. Immersive Spaces place the origin relative to the user at the time the scene is opened. This is always placed on the floor, directly below Apple Vision Pro. visionOS is remarkably good at knowing where the floor is at all times, even when it is obstructed from view. There are exceptions, but the origin is placed predictably for spaces.

A gizmo was placed where the user was standing when the scene was opened

Volumes place the origin in the center of the bounds for the volume. Here we see a volume with a default size of 500 on all sides. The origin is placed directly in the center.

A gizmo in the center of a volume

Windows are perhaps the most complicated. We think of windows as 2D, but they have depth just like volumes. The main difference is in orientation. The glass background of a window is the very “back” of that window. We can place content directly in front of it. The amount of space we have to work with is based on the size of the window. The origin is placed all the way at the “front” of the window, on the other end of the bounds from the glass background.

A gizmo positioned at the front of a window

visionOS seems to have some hidden logic to try to keep content visible in a window. For example, the Z axis from the gizmo should be clipped by the window bounds, but we can still see it. The visionOS debugging visualizations in Xcode can be helpful when deciding how to place your content in Windows.

visionOS debugging visualizations for a window

Support our work so we can continue to bring you new examples and articles.

Questions or feedback?