Volumetric space clipping RealityView 3d model

294 Views Asked by At

I am currently working on getting a 3d map of the US rendering in a volumetric window using RealityKit and RealityView, and no matter what I do, my model content is constantly clipped.

I am defining my window group as follows:

        WindowGroup {
            MapView()
        }
        .windowStyle(.volumetric)
        .defaultSize(Size3D(width: 2.7, height: 0.9, depth: 0.9), in: .meters)

And I am loading my usdz file in as such:

        RealityView { content in
            guard let usMap = try? await Entity(named: "us_map") else {
                return
            }

            content.add(usMap)
        }

What I end up with is the following:

3d US map

I have also attempted to adjust the default size of the window, and it appears to have no effect on the outcome (i.e. I've set the width to 10, and I get the same result).

I have ruled out usdz file issues since if I transform the model and translate it to the right, Alaska comes into view, but then the right side of the model gets clipped.

Is there something that I can do to prevent this from happening?

It's also worth noting this happens on a real Apple Vision Pro device as well.

1

There are 1 best solutions below

0
On BEST ANSWER

In visionOS 1.1, the max size of volumetric window is still 2x2x2 meters. Resize your model accordingly when you're placing it in RealityView, or apply autoscale inside Model3D view.