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

概述

要跟蹤真實或虛擬對象相對于相機的位置和方向键闺,請創(chuàng)建錨點對象并使用addAnchor:方法將它們添加到AR會話中恒傻。

在世界跟蹤會話中啟用planeDetection選項時,ARKit還會自動添加錨點


? ? ? ? ? ? ? ? ? ? Creating Custom Anchors


-?initWithTransform:
Creates a new anchor object with the specified transform.
用指定的變換創(chuàng)建一個新的錨點對象。

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.

參數(shù)

transform

一個矩陣扇住,用于編碼錨點相對于AR Session的世界坐標(biāo)空間的位置春缕,方向和比例尺。

ARKit中的世界坐標(biāo)空間總是遵循右手慣例艘蹋,但是基于會話配置而定向锄贼。 有關(guān)詳細信息,請參閱關(guān)于增強現(xiàn)實和ARKit女阀。

討論

使用addAnchor:方法開始在AR Session中跟蹤自定義錨點宅荤。


? ? ? ? ? ? ? ? ? ? ? ? ? ? Tracking Anchors


identifier
A unique identifier for the anchor.
錨點的唯一標(biāo)識符。

Discussion

Whether an anchor is created manually (with the?initWithTransform:?initializer) or automatically by ARKit (and provided to you through?ARSessionDelegate,?ARSCNViewDelegate, 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.

討論

無論是手動創(chuàng)建一個錨點(使用initWithTransform:初始化程序)浸策,還是由ARKit自動創(chuàng)建(并通過ARSessionDelegate冯键,ARSCNViewDelegate或ARSKViewDelegate方法提供給您),每個錨點都會自動接收唯一的標(biāo)識符值庸汗。

您可以使用此值來確定伴隨特定ARFrame捕獲的錨點對應(yīng)于之前捕獲的幀中的錨點琼了。

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的世界坐標(biāo)空間的位置夫晌,方向和比例尺雕薪。

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中的世界坐標(biāo)空間總是遵循右手慣例,但是基于會話配置而定向晓淀。 有關(guān)詳細信息所袁,請參閱關(guān)于增強現(xiàn)實和ARKit。


Inherits From?NSObject

Conforms To?NSCopying,?NSSecureCoding

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末凶掰,一起剝皮案震驚了整個濱河市燥爷,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌懦窘,老刑警劉巖前翎,帶你破解...
    沈念sama閱讀 218,036評論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異畅涂,居然都是意外死亡港华,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,046評論 3 395
  • 文/潘曉璐 我一進店門午衰,熙熙樓的掌柜王于貴愁眉苦臉地迎上來立宜,“玉大人,你說我怎么就攤上這事臊岸〕仁” “怎么了?”我有些...
    開封第一講書人閱讀 164,411評論 0 354
  • 文/不壞的土叔 我叫張陵帅戒,是天一觀的道長灯帮。 經(jīng)常有香客問我,道長,這世上最難降的妖魔是什么钟哥? 我笑而不...
    開封第一講書人閱讀 58,622評論 1 293
  • 正文 為了忘掉前任迎献,我火速辦了婚禮,結(jié)果婚禮上瞪醋,老公的妹妹穿的比我還像新娘忿晕。我一直安慰自己,他們只是感情好银受,可當(dāng)我...
    茶點故事閱讀 67,661評論 6 392
  • 文/花漫 我一把揭開白布践盼。 她就那樣靜靜地躺著,像睡著了一般宾巍。 火紅的嫁衣襯著肌膚如雪咕幻。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,521評論 1 304
  • 那天顶霞,我揣著相機與錄音肄程,去河邊找鬼。 笑死选浑,一個胖子當(dāng)著我的面吹牛蓝厌,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播古徒,決...
    沈念sama閱讀 40,288評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼拓提,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了隧膘?” 一聲冷哼從身側(cè)響起代态,我...
    開封第一講書人閱讀 39,200評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎疹吃,沒想到半個月后蹦疑,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,644評論 1 314
  • 正文 獨居荒郊野嶺守林人離奇死亡萨驶,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,837評論 3 336
  • 正文 我和宋清朗相戀三年歉摧,在試婚紗的時候發(fā)現(xiàn)自己被綠了。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片篡撵。...
    茶點故事閱讀 39,953評論 1 348
  • 序言:一個原本活蹦亂跳的男人離奇死亡判莉,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出育谬,到底是詐尸還是另有隱情,我是刑警寧澤帮哈,帶...
    沈念sama閱讀 35,673評論 5 346
  • 正文 年R本政府宣布膛檀,位于F島的核電站,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏咖刃。R本人自食惡果不足惜泳炉,卻給世界環(huán)境...
    茶點故事閱讀 41,281評論 3 329
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望嚎杨。 院中可真熱鬧花鹅,春花似錦、人聲如沸枫浙。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,889評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽箩帚。三九已至真友,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間紧帕,已是汗流浹背盔然。 一陣腳步聲響...
    開封第一講書人閱讀 33,011評論 1 269
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留是嗜,地道東北人愈案。 一個月前我還...
    沈念sama閱讀 48,119評論 3 370
  • 正文 我出身青樓,卻偏偏與公主長得像鹅搪,于是被迫代替她去往敵國和親站绪。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,901評論 2 355

推薦閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,332評論 0 10
  • A view for displaying AR experiences that augment the cam...
    loveFBI閱讀 2,432評論 0 0
  • 男孩與女孩涩嚣,可以說本來是兩條線崇众,永遠不會相交。唯一擁有的一點共同點可能是航厚,男孩算是出生于書香門第顷歌,而女孩喜歡看書。...
    主播Viva閱讀 383評論 0 3
  • 朋友間的聚會幔睬,有點刻意的寒暄眯漩,結(jié)果還是不經(jīng)意間回到了從前單純快樂只會傻笑的樣子!
    晚安好萌閱讀 113評論 0 0
  • 小情情小公主
    淺淺季節(jié)深深情閱讀 126評論 0 0