Open tedbarnett opened 1 month ago
@tedbarnett I've checked but the zoomed-in to zoomed-out is not supported in ARKit with ARWorldTrackingConfiguration. I tried it but there is not effect. Zoom scale stays at 1.0 even if I increase or decrease the value.
ChatGPT suggested these work=arounds. The last one sounds best if it's possible:
In ARKit, you can't directly change the "zoom" level of the camera since ARKit uses the physical camera on the iPhone and doesn't allow modification of its focal length or field of view (FOV) directly like a virtual camera in a 3D engine.
However, there are workarounds you can use to achieve a wider view of the scene:
Scale the Virtual Objects:
One common approach is to scale down the size of the virtual objects, which can give the effect of a wider view, as more of the scene will fit within the same camera view. Move the Camera Backward:
You can manipulate the scene by moving the position of the objects or virtual camera within the AR space. By shifting the content farther from the user, it can simulate a wider view. Use an Alternate Lens:
The iPhone has multiple cameras (standard, wide, ultra-wide, telephoto). You can switch to the ultra-wide camera on supported devices (like iPhone 16 Pro Max) by setting the videoFormat of the ARSession to use the ultra-wide camera. Here’s how you can switch to the ultra-wide camera in ARKit:
// Find the video format that uses the ultra-wide camera
let formats = ARWorldTrackingConfiguration.supportedVideoFormats
if let ultraWideFormat = formats.first(where: { format in
return format.cameraIntrinsicMatrix.columns.0.x < standardWidthThreshold
}) {
let config = ARWorldTrackingConfiguration()
config.videoFormat = ultraWideFormat
arView.session.run(config, options: [.resetTracking, .removeExistingAnchors])
}
This method allows you to use the ultra-wide camera for a wider field of view, making more of the scene visible. Keep in mind that the ultra-wide camera may not support all ARKit features like the standard camera does.
.5 wide angle would be most useful
@tedbarnett @ChiefSeattle I have already tried different solutions and the above code provided by ChatGPT but with ARWorldTrackingConfiguration we can't apply zoom effects.
We need to be able to switch to a wider camera angle sometimes to be able to see the house and Pergola.
Photo from an actual customer demo below. Note how far back we had to move to get the house and pergola to show up.
Can we add a slider control that will change the camera from zoomed-in to zoomed-out? If so: add to our set of buttons.