Contents

volumetric

A window style that creates a 3D volumetric window.

Declaration

static var volumetric: VolumetricWindowStyle { get }

Discussion

Use a volumetric window — or a volume — to display 3D content within a bounded region. For example, Hello World uses a volume to present a Globe model that people can pick up and move around the Shared Space using the window bar:

WindowGroup(id: Module.globe.name) {
    Globe()
        .environment(model)
}
.windowStyle(.volumetric)
.defaultSize(width: 0.6, height: 0.6, depth: 0.6, in: .meters)

A volume enables someone to view content from all angles, unlike other windows which fade out as people move around the window. Also unlike other windows, a volume uses fixed scale, which means that objects in the volume appear smaller when the volume is farther away, like real objects would. For a comparison of fixed and dynamic scale, see Spatial layout in the Human Interface Guidelines.

You can specify a size for the volume using one of the default size scene modifiers, like defaultSize(width:height:depth:in:). Because volumes use fixed scale, it’s typically convenient to specify a size in physical units — like meters, as the above code demonstrates. People can’t change the size of the volume after it appears.

For design guidance, see Windows in the Human Interface Guidelines. If you want to place 3D objects arbitrarily throughout the Shared Space or in a Full Space, use an ImmersiveSpace instead.

See Also

Getting built-in window styles