让位置 = SCNVector3(x: 0, y: 0, z: -2) 从原点到上述点的测量单位距离是多少
最佳答案
在 ARKit
中,测量单位是米
。
当您启动您的 ARKit
应用程序时,worldOrigin 设置为 SCNVector3Zero
,即 (0,0,0)(或在 X、Y、 Z轴相交):
ARKit defines a world coordinate space for you to use to place virtual content and locate detected objects in an AR experience. By default, this space is based on the initial position and orientation of the device when the session begins.
SCNVector3
很简单:
a three-component vector which is used for a variety of purposes, such as describing node or vertex positions, surface normals, and scale or translation transforms. The different vector components should be interpreted based on the context in which the vector is being used.
因此每个部分对应于 X、Y 和 Z 值例如:
let position = SCNVector3 (x, y, z)
鉴于您的position var
,您是说您想要将对象放置在关于worldOrigin
的中心位置,并且距离相机 2 米。
希望对你有帮助
关于swift - ARKit 中 x、y 和 z 的 SCNVector3 位置使用哪个测量单位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51760421/