ARKit中x,y和z的SCNVector3位置使用哪个测量单位 [英] Which measuring unit is used in SCNVector3 position for x, y and z in ARKit

查看:48
本文介绍了ARKit中x,y和z的SCNVector3位置使用哪个测量单位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让位置= SCNVector3(x:0,y:0,z:-2) 到原点到上述点的距离为多少度量单位

let position = SCNVector3(x: 0, y: 0, z: -2) what is the distance in measuring units from the origin to the above point

推荐答案

ARKit中,度量单位在Meters中.

启动ARKit应用程序时,worldOrigin设置为SCNVector3Zero,即(0,0,0)(或在X,Y,Z轴相交的图中):

When you launch your ARKit app, the worldOrigin is set at SCNVector3Zero which is (0,0,0) (or in the diagram where the X,Y,Z axis intersect):

ARKit定义了一个世界坐标空间,供您用来放置虚拟 内容并在AR体验中找到检测到的对象.默认情况下, 这个空间是基于 会话开始时的设备.

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值,例如:

So each part corresponds to the X, Y and Z values e.g:

let position = SCNVector3 (x, y, z)

鉴于您的position var,您要说的是要相对于worldOrigin将对象放置在中央位置,并且距离相机2米.

Given your position var you are saying that you want to place the object centrally in regard to the worldOrigin and 2meters away from the camera.

希望有帮助...

这篇关于ARKit中x,y和z的SCNVector3位置使用哪个测量单位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆