Integrate iOS device camera and motion features to produce augmented reality experiences in your app or game. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??集成iOS設備相機和動作功能,以在您的應用或游戲中制作增強現(xiàn)實體驗。?
Overview
Augmented reality (AR) describes user experiences that add 2D or 3D elements to the live view from a device's camera in a way that makes those elements appear to inhabit the real world. ARKit combines device motion tracking, camera scene capture, advanced scene processing, and display conveniences to simplify the task of building an AR experience.
概述
增強現(xiàn)實(AR)可以將2D或3D元素添加到設備攝像頭的實時視圖中,從而使這些元素看起來像真實世界中一樣,給用戶一種身臨其境的體驗。ARKit結合了設備運動跟蹤,相機場景捕捉,高級場景處理和顯示,便利,簡化了構建AR體驗的任務。
Important
ARKit requires an iOS device with an A9 or later processor.
To make your app available only on devices supporting ARKit, use thearkitkey in theUIRequiredDeviceCapabilitiessection of your app's Info.plist. If augmented reality is a secondary feature of your app, use theisSupportedproperty to determine whether the current device supports the session configuration you want to use.
重要
ARKit需要帶有A9或更高版本處理器的iOS設備。
要使您的應用僅在支持ARKit的設備上可用,請在應用的Info.plist的UIRequiredDeviceCapabilities部分使用arkit密鑰。 如果增強現(xiàn)實是您應用的輔助功能,請使用isSupported屬性來確定當前設備是否支持您要使用的會話配置。
Note
All AR configurations use one of the device's built-in cameras. Your app's Info.plist must include user-facing text for theNSCameraUsageDescriptionkey so that the user can grant your app permission to access the camera. (If you create a new ARKit app using the Xcode template, a description is provided for you.)
注意
所有AR配置都使用設備的內置攝像頭之一。 您應用的Info.plist必須包含NSCameraUsageDescription的面向用戶的文本,以便用戶可以授予您的應用訪問攝像機的權限。 (如果您使用Xcode模板創(chuàng)建新的ARKit應用程序,則會為您提供說明。)
First Steps
About Augmented Reality and ARKit
Discover supporting concepts, features, and best practices for building great AR experiences.
ARSession
A shared object that manages the device camera and motion processing needed for augmented reality experiences.
ARConfiguration
The abstract base class for AR session configurations.
第一步
關于增強現(xiàn)實和ARKit
?發(fā)現(xiàn)構建支持概念,功能和最佳實踐和最好的AR體驗。
ARSession
? 管理增強現(xiàn)實體驗所需的設備攝像頭和運動處理的共享對象。
ARConfiguration
?AR Session配置的抽象基類
World Tracking
Create AR experiences that allow a user to explore virtual content in the world around them with a device's back-facing camera.
Building Your First AR Experience
Create an app that runs an AR session and uses plane detection to place 3D content using SceneKit.
Handling 3D Interaction and UI Controls in Augmented Reality
Follow best practices for visual feedback, gesture interactions, and realistic rendering in AR experiences.
ARWorldTrackingConfiguration
A configuration that uses the back-facing camera, tracks a device's orientation and position, and detects real-world flat surfaces.
AROrientationTrackingConfiguration
A configuration that uses the back-facing camera and tracks only a device's orientation.
ARPlaneAnchor
Information about the position and orientation of a real-world flat surface detected in a world-tracking AR session.
世界追蹤
創(chuàng)建AR體驗,允許用戶使用設備的背面照相機探索周圍世界的虛擬內容。
建立你的第一個AR體驗
創(chuàng)建一個APP運行AR Session并使用平面檢測以便放置SceneKit創(chuàng)建的3D內容。
在增強現(xiàn)實中處理3D交互和UI控件
?遵循AR體驗中的視覺反饋,手勢交互和逼真渲染的最佳實踐。
ARWorldTrackingConfiguration
?使用背面照相機的配置,跟蹤設備的方向和位置,并檢測真實世界的平面。
AROrientationTrackingConfiguration
使用后置攝像頭并僅跟蹤設備方向的配置。
ARPlaneAnchor
?關于在世界跟蹤AR會話中檢測到的真實世界平面的位置和方向的信息。
Face Tracking
Use the TrueDepth camera on iPhone X to create AR experiences that respond to the user's face and facial expressions.
Creating Face-Based AR Experiences
Use the information provided by a face tracking AR session to place and animate 3D content.
ARFaceTrackingConfiguration
A configuration that tracks the movement and expressions of the user’s face with the TrueDepth camera.
ARFaceAnchor
Information about the pose, topology, and expression of a face detected in a face-tracking AR session.
面部追蹤
使用iPhone X上的TrueDepth相機創(chuàng)建響應用戶臉部和臉部表情的AR體驗。
創(chuàng)建基于臉部的AR體驗
使用人臉跟蹤AR Session提供的信息放置和動畫3D內容。
ARFaceTrackingConfiguration
使用TrueDepth相機跟蹤用戶臉部的移動和表情的配置。
ARFaceAnchor
有關在面部跟蹤AR會話中檢測到的人臉姿態(tài),拓撲和表情的信息。
Standard Views
ARSCNView
A view for displaying AR experiences that augment the camera view with 3D SceneKit content.
ARSKView
A view for displaying AR experiences that augment the camera view with 2D SpriteKit content.
標準視圖
ARSCNView
顯示使用3D SceneKit內容增強相機視圖的AR體驗的視圖。
ARSKView
顯示使用2D SpriteKit內容增強相機視圖的AR體驗的視圖
Custom Views
Displaying an AR Experience with Metal
Build a custom AR view by rendering camera images and using position-tracking information to display overlay content.
自定義視圖
Displaying an AR Experience with Metal
通過渲染相機圖像并使用位置跟蹤信息來顯示覆蓋內容來構建自定義AR視圖
Image Detection
Recognizing Images in an AR Experience
Detect known 2D images in the user’s environment, and use their positions to place AR content.
ARReferenceImage
An image to be recognized in the real-world environment during a world-tracking AR session.
ARImageAnchor
Information about the position and orientation of an image detected in a world-tracking AR session.
圖像檢測
在AR體驗中識別圖像
檢測用戶環(huán)境中的已知2D圖像,并使用它們的位置放置AR內容。
ARReferenceImage
在世界追蹤AR Session期間在真實世界環(huán)境中識別的圖像。
ARImageAnchor
在世界跟蹤AR Session中檢測到的圖像有關的位置和方向的信息。
Real-World Objects and Positions
ARHitTestResult
Information about a real-world surface found by examining a point in the device camera view of an AR session.
ARAnchor
A real-world position and orientation that can be used for placing objects in an AR scene.
ARTrackable
A real-world object in a scene for which ARKit tracks changes to position and orientation.
真實世界的對象和位置
ARHitTestResult
通過檢查AR會話的設備攝像頭視圖中的點找到有關真實世界表面的信息。
ARAnchor
真實世界的位置和方向,可用于將對象放置在AR場景中。
ARTrackable
ARKit跟蹤位置和方向變化的場景中的真實世界對象。
Camera and Scene Details
ARFrame
A video image, with position-tracking information, captured as part of an AR session.
ARCamera
Information about the camera position and imaging characteristics for a captured video frame in an AR session.
ARLightEstimate
Estimated scene lighting information associated with a captured video frame in an AR session.
ARDirectionalLightEstimate
Estimated environmental lighting information associated with a captured video frame in a face-tracking AR session.
相機和場景細節(jié)
ARFrame
具有位置跟蹤信息的視頻圖像作為AR會話的一部分被捕獲。。
ARCamera
有關AR會話中捕獲的視頻幀的攝像頭位置和成像特征的信息。。
ARLightEstimate
估計場景照明信息與AR會話中捕獲的視頻幀相關聯(lián)。
ARDirectionalLightEstimate
估計的環(huán)境照明信息與臉部追蹤AR Session中捕獲的視頻幀相關聯(lián)。
Advanced Topics
Using Vision in Real Time with ARKit
Manage Vision resources for efficient execution of a Core ML image classifier, and use SpriteKit to display image classifier output in AR.
高級主題
在ARKit中實時使用Vision
管理Vision資源以有效執(zhí)行Core ML圖像分類器,并使用SpriteKit在AR中顯示圖像分類器輸出。