我正在尝试重现 ARCamera 的项目点函数,但由于某种原因,这些值没有正确匹配。我采用 ARCamera 的投影矩阵和视图矩阵,并应用基本的 CG 透视变换数学 (PV) * p,但 NDC 值与 ARCamera 的项目点函数给出的像素值不匹配。有任何想法吗?我是不是忘记了什么?
更多细节:
基本上,我试图通过单击按钮来获取 ARFrame,然后尝试复制https://developer.apple.com/documentation/arkit/arcamera/2923538-projectpoint https://developer.apple.com/documentation/arkit/arcamera/2923538-projectpoint。我正在尝试这样做https://developer.apple.com/documentation/arkit/arcamera/2887458-projectionmatrix https://developer.apple.com/documentation/arkit/arcamera/2887458-projectionmatrix and https://developer.apple.com/documentation/arkit/arcamera/2921672-viewmatrix https://developer.apple.com/documentation/arkit/arcamera/2921672-viewmatrix,确保两个部分的所有输入都匹配。 CG尺寸用于将坐标从NDC空间变换到图像空间。
编辑:找到解决方案,检查下面的评论。
问题原来是投影矩阵 https://developer.apple.com/documentation/arkit/arcamera/2887458-projectionmatrix有时无法正确找到设备方向。正确的方法是使用投影矩阵(对于:视口大小:zNear:zFar:) https://developer.apple.com/documentation/arkit/arcamera/2923539-projectionmatrix.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)