arcore_ARCore如何使您创建全新的用户交互类型(第二部分)

arcore

In Part I of our ARCore series, we shared some creative ideas on how you can use capabilities like light estimation to unlock new forms of user interaction and gameplay, part II shares some more practical use cases for additional ARCore features like Instant preview and Motion tracking.

在ARCore系列的第一部分中,我们分享了一些有关如何使用光估计等功能来解锁新形式的用户交互和游戏玩法的创意,第二部分分享了一些其他ARCore功能(如即时预览和运动跟踪)的更实际的使用案例。 。

Can you picture a Jenga game in AR? (If you’re not familiar with the game, the purpose is to build a progressively taller tower by removing blocks from the structure and then placing them on top of the tower.) In part II of our ARCore blog post series, we share some more practical ideas for leveraging ARCore capabilities like motion tracking to build a Jenga handheld AR game or the AR Session Pause function to keep users engaged when your ARCore app loses focus.

您可以在AR中描绘Jenga游戏吗? (如果您对游戏不熟悉,其目的是通过从结构中移除块,然后将其放置在塔顶上来建造一个逐渐变高的塔。)在我们的ARCore博客系列文章的第二部分中,我们分享了一些利用ARCore功能(例如运动跟踪来构建Jenga手持式AR游戏)或AR Session Pause功能以使用户在ARCore应用失去焦点时保持参与的更实用想法。

运动追踪和接近 (Motion tracking and proximity)

With features like motion tracking, you can do anything from triggering animations based on the device’s position and orientation, to using the device as a physical bumper based on its proximity to a digital object. An interesting use case of proximity is Jenga. Using the device’s position relative to the digital tower, you can move around to find the right block you want to manipulate and use simple and familiar gestures to remove the block and then place it back on top of the tower.

借助运动跟踪等功能,您可以执行任何操作,从基于设备的位置和方向触发动画,到根据设备与数字物体的接近程度将其用作物理缓冲器。 Jenga是一个有趣的接近用例。 使用设备相对于数字塔的位置,您可以四处走动以找到要操纵的正确块,并使用简单熟悉的手势将其移除,然后将其放回塔顶。

A super fun ARCore experience: In this example, you are manipulating the digital object directly using familiar and simple gestures, such as holding the block while pressing it on screen and moving your device to find where to release the block by letting go of the screen

超级有趣的ARCore体验:在此示例中,您将使用熟悉且简单的手势直接操作数字对象,例如在按住块的同时将其按在屏幕上,并通过松开屏幕来移动设备以查找释放块的位置

User interactions based on proximity and motion tracking will continue to play a major role in handheld AR user interaction. If you have any more ideas on how to  leverage these ARCore features, please share them on our Connect handheld AR channel!

基于接近度和运动跟踪的用户交互将继续在手持式AR用户交互中扮演重要角色。 如果您对如何利用这些ARCore功能有更多的想法,请在我们的Connect手持式AR频道上分享它们!

暂停AR会话 (Pausing AR session)

Enabling users to pause their AR session is a must for keeping users engaged. A user might want a pause in the action or simply stop using augmented reality in the app. In order to allow them to pause,  you could make it possible to stop the entire AR session and start a new one when the user is ready to return to AR mode. In this way, however you risk losing user engagement as for now this would require the user to find planes or place objects in the world once again.

要使用户保持参与状态,必须使用户能够暂停其AR会话。 用户可能需要暂停动作,或者只是停止在应用程序中使用增强现实。 为了允许他们暂停,可以使整个AR会话停止,并在用户准备返回AR模式时开始一个新的会话。 这样,您可能会失去与用户的联系,因为现在这将需要用户再次找到飞机或将对象放置在世界中。

Another option is to use ARCore’s functionality for short term pauses. This can maintain planes and placed objects where they are while stopping the app from searching for new planes and trying to track motion.

另一个选择是使用ARCore的功能进行短期暂停。 这样可以在停止应用程序搜索新飞机并尝试跟踪运动的同时,将飞机和放置的物体保持在原处。

Because pausing an AR session is supported natively in ARCore, as a developer all you have to do is disable the ARCoreSession component in Unity.

因为ARCore本身支持暂停AR会话,所以作为开发人员,您要做的就是禁用Unity中的ARCoreSession组件。

1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleARCore;
public class PauseAR : MonoBehaviour
{
    public ARCoreSession SessionController;
    private bool m_sessionPaused = false;
    public void TooglePauseMode()
    {
        if (SessionController == null)
        {
            return;
        }
        SessionController.enabled = m_sessionPaused;
        m_sessionPaused = !m_sessionPaused;
    }
}

1

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System . Collections ;
using System . Collections . Generic ;
using UnityEngine ;
using GoogleARCore ;
public class PauseAR : MonoBehaviour
{
     public ARCoreSession SessionController ;
     private bool m_sessionPaused = false ;
     public void TooglePauseMode ( )
     {
         if ( SessionController == null )
         {
             return ;
         }
         SessionController . enabled = m_sessionPaused ;
         m_sessionPaused = ! m_sessionPaused ;
     }
}

Pausing your AR app doesn’t only apply to allowing users to take a random break. Some other notable use cases are a multiplayer game that uses a single device briefly pausing a session between turns, or simply allowing the user to take a phone call without losing where they left off.

暂停您的AR应用程序不仅适用于允许用户随机休息。 其他一些值得注意的用例是多人游戏,它使用单个设备在回合之间短暂地暂停会话,或者只是允许用户拨打电话而不会丢失他们离开的地方。

The action is paused and a full screen UI appears, after unpausing the AR functionality the same planes and flower come back.

取消暂停AR功能后,动作将暂停并显示全屏UI,然后返回相同的平面和花朵。

Something to keep in mind is that this is still just a temporary pause, if the user moves drastically and the same plane or feature points can’t be found again, objects might not be kept between pauses.

要记住的是,这仍然只是暂时的停顿,如果用户剧烈移动并且再次找不到相同的平面或特征点,则可能无法在停顿之间保留对象。

AR的Instant Preview:在构建时进行测试 (Instant Preview for AR: test as you build)

New in ARCore v1.1.0 for Unity is Instant preview. Available only in Unity, this tool allows you to skip the build process and test any changes to your AR app on ARCore-compatible devices as you build your project in Unity. This shortens the process from minutes to milliseconds enabling you to iterate in near real-time, check the state of objects, debug errors and view the position and scale of objects directly from the Unity Editor.

Unity的ARCore v1.1.0中的新增功能是即时预览。 此工具仅在Unity中可用,在Unity中构建项目时,您可以跳过构建过程并测试在ARCore兼容设备上对AR应用程序所做的任何更改。 这样可以将过程从几分钟缩短到几毫秒,使您可以近乎实时地进行迭代,检查对象的状态,调试错误以及直接从Unity Editor中查看对象的位置和比例。

To get started with Instant preview, setup ARCore 1.1 for Unity and install the HelloAR scene on a compatible device. By default, data from the device such as the camera’s position and orientation, plane finding, feature points, light estimation and touch-input will be streamed into the Unity Editor and displayed in the game window. By making all of this information available directly in Unity, you can test and iterate on new features much quicker.

要开始使用即时预览, 请为Unity设置ARCore 1.1并将HelloAR场景安装在兼容的设备上。 默认情况下,来自设备的数据(例如相机的位置和方向,平面查找,特征点,光线估计和触摸输入)将流式传输到Unity Editor中并显示在游戏窗口中。 通过直接在Unity中提供所有这些信息,您可以更快地测试和迭代新功能。

While the majority of AR is experienced through the lens of a mobile device in real-world conditions, you are normally developing on a laptop or desktop with no connection to  that world. Instant Preview makes it possible to test in the real world — perhaps one of the hardest and most important things to do when developing a mobile-AR app. It enables you to test real-world aspects, lie  like the contrast between shaders and real physical materials or how different lighting conditions may affect your AR experience, directly in the Unity Editor.

虽然大多数AR是在现实条件下通过移动设备的镜头来体验的,但您通常是在没有连接该世界的笔记本电脑或台式机上进行开发的。 Instant Preview使在现实世界中进行测试成为可能,这可能是开发移动AR应用程序时最难,最重要的事情之一。 它使您可以直接在Unity Editor中测试现实世界的各个方面,例如着色器与实际物理材料之间的对比度,或不同的光照条件如何影响您的AR体验。

Imagine testing and iterating on object materials with a view into the real world from the Unity Editor.

想象一下在对象材料上进行测试和迭代,并从Unity编辑器中了解现实世界。

Instant preview is already on by default in ARCore v1.1.0 for Unity, so get started right away! For more information and details, check out Google’s documentation.

默认情况下,Unity的ARCore v1.1.0中已经启用了即时预览,因此请立即开始! 有关更多信息和详细信息, 请查阅Google文档

ARCore资源以及如何分享您的想法 (ARCore resources and how to share your ideas)

Share your ideas with the community and use ARCore 1.1.0 for Unity to create high+quality AR apps for more than 100 million Android devices on Google Play! Here’s how.

与社区分享您的想法,并使用ARCore 1.1.0 for Unity在Google Play上为超过1亿个Android设备创建高质量的AR应用! 这是如何做。

  1. Set up ARCore 1.0 for Unity.

    为Unity设置ARCore 1.0

  2. Join the Unity Connect Handheld AR channel for an opportunity to meet, chat, and learn from other community creators working on AR apps.

    加入Unity Connect手持式AR频道 ,有机会与其他使用AR应用程序的社区创建者见面,聊天和学习。

翻译自: https://blogs.unity3d.com/2018/04/06/how-arcore-enables-you-to-create-brand-new-types-of-user-interaction-part-ii/

arcore

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值