How to set the default size of WindowGroup volumetric in SwiftUI to fit the size of Model Entity loaded in USDZ

Hello, I'm here. I am posting this in the hope that you can give me some advice on what I would like to achieve.

What I would like to achieve is to download the USDZ 3D model from the web server within the visionOS app and display it with the Shared Space volume (volumetric) size set to fit the downloaded USDZ model.

Currently, after downloading USDZ and generating it as a Model Entity, Using openWindow, The Model Entity is created as a volumetric WindowGroup in the RealityViewContent of the RealityView using openWindow. The Model Entity generated by downloading USDZ is added to the RealityViewContent of the RealityView in the View called by openWindow.

The USDZ downloaded by the above method appears in the volume on visionOS without any problems. However, the size of the USDZ model to be downloaded is not uniform, so it may not fit in the volume.

I am trying to generate a WindowGroup with openWindow using Binding with the appropriate size value set to defaultSize, but I am not sure which property of ModelEntity can be set to the appropriate value for defaultSize.

The attached image does not have the correct position and I would like to place the position down if possible.

I would appreciate your advice on sizing and positioning the downloaded USDZ to fit in the volume. Incidentally, I tried a plane style window and found that it displayed a USDZ Model Entity that was much larger in scale compared to the volume, so I have decided not to support a plane style window.

If there is any information on how to properly set the position and size of the USDZ files created by visionOS and RealityKit, I would appreciate it if you could also provide it.

Best regards.

Sadao Tokuyama

https://twitter.com/tokufxug

https://1planet.co.jp/tech-blog/category/applevisionpro

The AR Quick Look in visionOS scales the USDZ to its full size without missing any USDZ display when 100% is specified. It would be best if we could achieve the functionality provided by this AR Quick Look.

How to set the default size of WindowGroup volumetric in SwiftUI to fit the size of Model Entity loaded in USDZ
 
 
Q