【问题标题】:What do the values in the ARCamera transform matrix_identity_float4x4 represent?ARCamera 变换 matrix_identity_float4x4 中的值代表什么?
【发布时间】:2018-02-11 13:19:48
【问题描述】:

我一直在使用 ARKit 进行试验,发现 ARCamera().transform 属性中的 4x4 矩阵的文档非常简单,我想知道是否有人对矩阵中的每一列/行所代表的内容有任何了解?我能够从 WWDC 视频中收集到第 3 列用于 x y 和 z 翻译,但我无法找到有关其余值的文档。任何解决此问题的帮助将不胜感激。

【问题讨论】:

标签: ios scenekit arkit


【解决方案1】:

鉴于相机在世界坐标 (camera.transform) 中的位置,您可能希望使用单位矩阵来访问相机视图前面(沿 z 轴)的空间(另一种方法是通过相机的projectionMatrix 和 hitResult 测试,但这种用法需要更复杂的矩阵数学,这仍然让我感到困惑)。

例如 var translation = matrix_identity_float4x4 // this is the magic sauce here translation.columns.3.z = -1.0 let pos = transform! * translation let position = SCNVector3(pos.columns.3.x, pos.columns.3.y, pos.columns.3.z)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-01-08
    • 1970-01-01
    • 2019-08-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-12-21
    • 1970-01-01
    相关资源
    最近更新 更多