0

I work with ARAnchor in my project and I want to get the position (3D) from this anchor.

The code:

sceneView.session.currentFrame?.anchors.first?.transform.transpose 

return me a float4x4 SIMD vector.

But what means the separate values?

My vector:

[-0.030081563,  0.999284570,   0.022921648,   0.06462159], 
[ 0.574515400, -0.0014799305,  0.8184924,    -0.47270963], 
[ 0.0,          0.0,           0.0,           1.0       ]
Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
Hans
  • 49
  • 5

1 Answers1

1

Apple documentation says:

The SIMD provides support for matrices of up to 4 rows and 4 columns, containing 16 elements.

All those 16 elements are designed to provide you with a translation, rotation, scaling, and skewing for X-, Y- and Z-axis (as well as projection).

You can read this post for further detailed information about 4x4 matrices.

And here's how translation elements look like in 4x4 matrix:

    ┌               ┐
    |  1  0  0  tx  |
    |  0  1  0  ty  |
    |  0  0  1  tz  |
    |  0  0  0  1   |
    └               ┘

Also, you can read a wikipedia article about transpose matrices.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220