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

查看:40
本文介绍了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.

In ARKit the unit of measurement is in 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天全站免登陆