I have written a small app which recognizes an image and then places spheres on the four corners and in the center. This is the code which places them:
let width = Float(imageAnchor.referenceImage.physicalSize.width)
let height = Float(imageAnchor.referenceImage.physicalSize.height)
let x = imageAnchor.transform.columns.3.x
let y = imageAnchor.transform.columns.3.y
let z = imageAnchor.transform.columns.3.z
let lowerLeft = SIMD3<Float>(x - width/2, y - height/2, z)
let lowerRight = SIMD3<Float>(x + width/2, y - height/2, z)
let upperRight = SIMD3<Float>(x + width/2, y + height/2, z)
let upperLeft = SIMD3<Float>(x - width/2, y + height/2, z)
let center = SIMD3<Float>(x, y, z)
self.model_01.position = lowerLeft // pink
self.model_02.position = lowerRight // blue
self.model_03.position = upperRight // red
self.model_04.position = upperLeft // green
self.model_05.position = center // yellow
I have run this app on a 14 Pro Max and a X, both running iOS 16.3. On both devices the spheres that should be on the corners are placed quite a ways in from the actual corners, though still in a rectangular pattern of the same aspect ratio.
When my co-worker runs the app built on his computer from the same source, using the same reference image, the spheres are placed at the corners as they should be. He has an 11 Pro running 15.7 and a X running 16.3, and gets the same result on both.
Our values for width, height, x, y, and z are all the same, but somehow the outcome is still different. We've eliminated all the variables we can think of, like displaying the reference image on our laptop screens which are the same model.
What could possibly be causing this???