How do I create an unbounded volume in visionOS?

Generated on 10/22/2024

1 search

To create an unbounded volume in visionOS, you can utilize the new features introduced in visionOS 2. The process involves using the spatial API built for visionOS, which allows for the creation of volumetric apps that can take full advantage of depth and space. Here are some key points to consider:

  1. Volume Creation: When you create a new volumetric app or link an existing app against the visionOS 2 SDK, a new baseplate appears automatically. This baseplate highlights the bottom edges of the volume, guiding you to the edges of the volume space.

  2. Volume Resizing: You can set your volume size using the SwiftUI scene modifier window resizeability. This allows you to adjust the volume size to fit your content. Users can also resize volumes themselves, similar to resizing a window.

  3. Dynamic Scale: You have the option to choose between a fixed or dynamic scale for your volume. A dynamic scale means that as the 3D object moves away from the user, it appears smaller, mimicking real-world behavior.

  4. World Alignment: You can control how volumes present themselves within the world using the world alignment modifier. This determines whether the volume remains gravity-aligned or tilts as it is raised.

For a detailed walkthrough on building a volumetric app, you can refer to the session Dive deep into volumes and immersive spaces (02:04) which covers the creation and manipulation of volumes in visionOS.