ARKit文档(部分翻译)及demo效果展示

ARKit

Integrate iOS device camera and motion features to produce augmented reality experiences in your app or game.
iOS设备集成相机和运动特性产生增强现实体验在你的应用程序或游戏。

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.

增强现实(AR)描述了用户体验,2d或3d元素添加到设备的摄像头的实时视图的方式使这些元素似乎生活在真实的世界。ARKit结合设备运动跟踪,相机镜头捕捉,先进的现场处理,并显示方便简化的任务构建一个基于“增大化现实”技术的经验。

Important
ARKit requires an iOS device with an A9 or later processor.
To make your app available only on devices supporting ARKit, use the arkit key in the UIRequiredDeviceCapabilities section of your app’s Info.plist. If augmented reality is a secondary feature of your app, use the isSupported property to determine whether the current device supports the session configuration you want to use.

ARKit需要一个iOS设备A9之后处理器。让你的应用程序只能在设备支持ARKit,使用ARKit UIRequiredDeviceCapabilities部分的关键应用程序的Info.plist。如果增强现实应用程序是一个次要的特性,使用isSupported属性,以确定当前设备支持会话配置您想要使用。

Topics
First Steps
Understanding Augmented Reality 理解增强现实
Discover concepts, features, and best practices for building great AR experiences.
了解概念,特性,构建基于“增强现实”技术和最佳实践经验。

class ARSession
A shared object that manages the device camera and motion processing needed for augmented reality experiences.
共享对象管理所需的设备相机和运动处理增强现实体验。
(备注:核心类)

Configurations 配置
class ARWorldTrackingConfiguration
A configuration that tracks a device’s orientation and position, and that detects real-world surfaces seen by the device camera.
配置跟踪设备的方向和位置,以及检测设备摄像头看到的现实世界的表面。

class AROrientationTrackingConfiguration
A configuration that tracks only a device’s orientation.
配置跟踪设备的方向。

class ARConfiguration
The abstract base class for AR session configurations.
AR会话配置的抽象基类。

Standard Views
ArticleBuilding a Basic AR Experience
Configure an AR session and use SceneKit or SpriteKit to display AR content.
配置一个AR会话和使用SceneKit或SpriteKit显示基于“增强现实”技术的内容。
(前面的是3d,后面的2d)

class ARSCNView
A view for displaying AR experiences that augment the camera view with 3D SceneKit content.
一个视图来显示基于“增强现实”技术的经验,增强与3d SceneKit相机视图的内容。

class ARSKView
A view for displaying AR experiences that augment the camera view with 2D SpriteKit content.
一个视图来显示基于“增强现实”技术的经验,增强与2d SpriteKit相机视图的内容。

Custom Views
ArticleDisplaying an AR Experience with Metal
Build a custom AR view by rendering camera images and using position-tracking information to display overlay content.
构建一个定制的基于“增强现实”技术的观点通过渲染相机图像和使用位置跟踪信息显示覆盖的内容。

Real-World Objects and Positions
class ARAnchor
A real-world position and orientation that can be used for placing objects in an AR scene.
一个真实的位置和姿态,可用于将对象放置在一个基于“增强现实”技术的游戏场景。

class ARPlaneAnchor
Information about the position and orientation of a real-world flat surface detected in an AR session.
有关位置和姿态信息的实际平面探测到AR会话。

class ARHitTestResult
Information about a real-world surface found by examining a point in the device camera view of an AR session.
发现现实的表面,通过检查设备的相机视图中一个点的AR会话。

Camera and Scene Details
class ARFrame
A video image and position tracking information captured as part of an AR session.
捕获和位置跟踪视频图像信息作为一个AR会话的一部分。

class ARCamera
Information about the camera position and imaging characteristics for a captured video frame in an AR session.
摄像机的位置和成像特征信息捕获视频帧的AR会话。
class ARLightEstimate
Estimated scene lighting information associated with a captured video frame in an AR session.
在一个AR会话中估计场景照明信息关联到一个视频帧捕获。

Renamed

class ARSessionConfigurationclass ARWorldTrackingSessionConfiguration

这两个划掉了。

Beta Software
This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
这个文档包含一个初步的API或技术开发的信息。这些信息有变更,软件实现根据这个文档还会测试最后的操作系统软件。
Learn more about using Apple’s beta software

Class
ARSession
A shared object that manages the device camera and motion processing needed for augmented reality experiences.
共享对象管理所需的设备相机和运动处理增强现实体验。

Overview
An ARSession object coordinates the major processes that ARKit performs on your behalf to create an augmented reality experience. These processes include reading data from the device’s motion sensing hardware, controlling the device’s built-in camera, and performing image analysis on captured camera images. The session synthesizes all of these results to establish a correspondence between the real-world space the device inhabits and a virtual space where you model AR content.
Every AR experience built with ARKit requires a single ARSession object. If you use an
ARSCNView
or
ARSKView
object to easily build the visual part of your AR experience, the view object includes an ARSession instance. If you build your own renderer for AR content, you’ll need to instantiate and maintain an ARSession object yourself.
Running a session requires a session configuration: an instance of the
ARSessionConfiguration
class, or its subclass
ARWorldTrackingSessionConfiguration
. These classes determine how ARKit tracks a device’s position and motion relative to the real world, and thus affect the kinds of AR experiences you can create.

ARSession对象坐标ARKit执行代表你的主要流程创建一个增强现实体验。这些过程包括从设备读取数据的运动传感硬件、控制设备的内置摄像头,对摄像机捕获图像进行图像分析。会话综合所有这些结果之间建立对应关系该设备所栖息的真实世界的空间和虚拟空间模型基于“增大化现实”技术的内容。每个用ARKit构建的基于“增大化现实”技术的经验需要一个ARSession对象。如果你使用一个ARSCNView或ARSKView对象来轻松地构建基于“增大化现实”技术的视觉部分经验,该视图对象包含一个ARSession实例。如果你构建自己的渲染器基于“增大化现实”技术的内容,你需要实例化和维护一个ARSession对象自己。运行一个会话需要会话配置:的一个实例ARSessionConfiguration类,或其子类ARWorldTrackingSessionConfiguration。这些类确定ARKit跟踪设备的位置和运动相对于现实世界,从而影响您可以创建的基于“增大化现实”技术的经验。

ARKit文档链接:https://developer.apple.com/documentation/arkit

官网提供的demo可以感受下:

- (void)viewDidLoad {
    [super viewDidLoad];

    // Set the view's delegate
    self.sceneView.delegate = self;

    // Show statistics such as fps and timing information
    self.sceneView.showsStatistics = YES;

    // Create a new scene
    SCNScene *scene = [SCNScene sceneNamed:@"art.scnassets/ship.scn"];

    // Set the scene to the view
    self.sceneView.scene = scene;
}

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    // Create a session configuration
    ARWorldTrackingSessionConfiguration *configuration = [ARWorldTrackingSessionConfiguration new];

    // Run the view's session
    [self.sceneView.session runWithConfiguration:configuration];
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];

    // Pause the view's session
    [self.sceneView.session pause];
}

看,灰机✈️

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ARKit 是苹果公司开发增强现实AR)技术框架,它可以利用 iOS 设备的摄像头和传感器来实时识别和跟踪现实世界中的平面和物体。通过 ARKit,我们可以开发出各种具有AR功能的应用程序,例如游戏、虚拟家具展示和虚拟导航等。 ARKit 可以通过识别图像来展示相应的图片。在开发过程中,我们需要提供一系列要识别的图像,这些图像可以是品牌标志、艺术品、产品封面等等。首先,我们需要在应用中添加这些图像作为AR识别的目标。然后,当用户在AR环境中将相机对准这些图像之一时,ARKit会通过计算机视觉和图像分析技术来识别该图像。一旦识别成功,ARKit就能够将相应的虚拟内容与现实世界进行融合,将其显示在用户的摄像头视角或手机屏幕上。 通过ARKit识别图像展示图片,我们可以实现许多有趣的功能。例如,在一个博物馆的AR应用中,当用户将相机对准一幅名画时,ARKit可以实时识别出这幅画,并在画面上叠加显示该画的相关信息和背景故事。在一个建筑设计应用中,当用户将相机对准一个建筑物的平面图时,ARKit可以识别该平面图,并在屏幕上显示出该建筑物的3D模型,让用户可以更直观地了解建筑物的外观和结构。 总之,ARKit的识别图像展示图片功能为开发者提供了一个强大的工具,可以轻松实现AR与现实世界之间的互动和融合,给用户带来更丰富、沉浸式的AR体验。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值