ARKit and SceneKit coordinates

I am trying to understand the difference between another element introduced in ArKit and their equivalents in SceneKit:

  • SCNNode.simdTransform vs SCNNode.transform . In ARKit, it seems like people are using SCNNode.simdTransform instead of SCNNode.transform . How do they differ? simdTransform seems to use the basic column order, while the transform (SCNMatrix4) is the main one. How to convert one to another? Just transpose? I got the impression that tracking doesn't work if I use transform instead of simdTransform . Was this expected or just an impression? If I set one property, what happens if I then set another?

  • ARFrame.camera vs Scene.pointOfView : looking at their transformations, they seem a little different:

.

 // ARFrame.camera.transform (matrix_float4x4) -0.01 0.99 -0.11 0.02 -0.99 0.00 0.11 0.06 0.10 0.11 0.98 0.0 0.0 0.0 0.0 1.0 // sceneView.pointOfView.transform (SCNMatrix4) // or sceneView.pointOfView.simdTransform^T (matrix_float4x4) 0.99 0 0.11 0 0.01 0.99 -0.12 0 -0.11 0.11 0.98 0 0.03 0.6 0.0 0.99 

Are they the same minus one revolution?

+7
ios11 arkit scenekit
source share
1 answer

Both SceneKit and ARKit include characters defined as SIMD types. Because ARKit imports SceneKit, the SIMD characters defined in SceneKit are available to both. SIMD types provide parallel computation, so using them can improve the performance of your application update logic. As you have discovered, there is not always a convenient way to convert between a SIMD type and its older equivalent, SceneKit or Core Graphics, so you usually get clean code using SIMD consistently where possible.

Updating any property that affects the node transform also updates its other transform properties. This also applies to local and world coordinates.

The camera ARFrame property describes the deviceโ€™s hardware camera, not the virtual camera used to render the scene. Although I would expect close correspondence, I suppose you polled an ARCamera instance before the SCNCamera instance was updated during the render cycle. If you can, I recommend that you manage these updates from the appropriate delegate methods, as you will know that the relevant data has been updated.

+5
source share

All Articles