ARAnchor

A real-world position and orientation that can be used for placing objects in an AR scene.

真实世界的位置和方向,可用于将对象放置在AR场景中。


Overview

To track the positions and orientations of real or virtual objects relative to the camera, create anchor objects and use the addAnchor: method to add them to your AR session.

ARKit also automatically adds anchors when you enable the planeDetection option in a world tracking session

概述

要跟踪真实或虚拟对象相对于相机的位置和方向,请创建锚点对象并使用addAnchor:方法将它们添加到AR会话中。

在世界跟踪会话中启用planeDetection选项时,ARKit还会自动添加锚点


                    Creating Custom Anchors


- initWithTransform:
Creates a new anchor object with the specified transform.
用指定的变换创建一个新的锚点对象。

Parameters

transform

A matrix encoding the position, orientation, and scale of the anchor relative to the world coordinate space of the AR session the anchor is placed in. 

World coordinate space in ARKit always follows a right-handed convention, but is oriented based on the session configuration. For details, see About Augmented Reality and ARKit.

Discussion

Use the addAnchor: method to begin tracking your custom anchor in an AR session.

参数

transform

一个矩阵,用于编码锚点相对于AR Session的世界坐标空间的位置,方向和比例尺。

ARKit中的世界坐标空间总是遵循右手惯例,但是基于会话配置而定向。 有关详细信息,请参阅关于增强现实和ARKit。

讨论

使用addAnchor:方法开始在AR Session中跟踪自定义锚点。


                            Tracking Anchors


identifier
A unique identifier for the anchor.
锚点的唯一标识符。

Discussion

Whether an anchor is created manually (with the initWithTransform: initializer) or automatically by ARKit (and provided to you through ARSessionDelegateARSCNViewDelegate, or ARSKViewDelegate methods), each anchor automatically receives a unique identifier value.

You can use this value to determine which anchors accompanying a specific ARFrame capture correspond to anchors in frames captured previously.

讨论

无论是手动创建一个锚点(使用initWithTransform:初始化程序),还是由ARKit自动创建(并通过ARSessionDelegate,ARSCNViewDelegate或ARSKViewDelegate方法提供给您),每个锚点都会自动接收唯一的标识符值。

您可以使用此值来确定伴随特定ARFrame捕获的锚点对应于之前捕获的帧中的锚点。

transform
A matrix encoding the position, orientation, and scale of the anchor relative to the world coordinate space of the AR session the anchor is placed in.
一个矩阵,用于编码锚点相对于AR Session的世界坐标空间的位置,方向和比例尺。

Discussion

World coordinate space in ARKit always follows a right-handed convention, but is oriented based on the session configuration. For details, see About Augmented Reality and ARKit.

讨论

ARKit中的世界坐标空间总是遵循右手惯例,但是基于会话配置而定向。 有关详细信息,请参阅关于增强现实和ARKit。


Inherits From NSObject

Conforms To NSCopyingNSSecureCoding

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,448评论 0 10
  • A view for displaying AR experiences that augment the cam...
    loveFBI阅读 2,492评论 0 0
  • 男孩与女孩,可以说本来是两条线,永远不会相交。唯一拥有的一点共同点可能是,男孩算是出生于书香门第,而女孩喜欢看书。...
    主播Viva阅读 396评论 0 3
  • 朋友间的聚会,有点刻意的寒暄,结果还是不经意间回到了从前单纯快乐只会傻笑的样子!
    晚安好萌阅读 124评论 0 0
  • 小情情小公主
    浅浅季节深深情阅读 131评论 0 0