Hans
Hans

Reputation: 49

ARAnchor return SIMD 4x4 vector - what is the meaning?

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       ]

Upvotes: 0

Views: 804

Answers (1)

Andy Jazz
Andy Jazz

Reputation: 58053

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.

Upvotes: 1

Related Questions