Hololens 学习摘要及翻译记录 三 Gaze

阅朗微软官方文档并作出简要记录:

https://developer.microsoft.com/zh-cn/windows/holographic/documentation

个人学习记录,有错误欢迎指出。


HoloLens的六个基本概念之二


Gaze : 凝视(相当于鼠标一样的东西,) https://developer.microsoft.com/zh-cn/windows/holographic/gaze


1.Gaze is the first form of input and is used for targeting within holographic apps. Gaze tells you where the user is looking in the world and lets you determine their intent. In the real world, you'll typically look at an object that you intend to interact with. This is the same with gaze.

凝视是最主要的输入方式,用来在全息应用中选定目标。它可以告诉使用者正看着世界的哪个地方,并且让你决定它们的意义。在真实世界中,最具代表性的就是当你看着一个对象的时候就是想与它进行交互。


2.HoloLens uses the position and orientation of your user's head, not their eyes, to determine their gaze vector. You can think of this vector as a laser pointer straight ahead from directly between the user's eyes. As the user looks around the room, your application can intersect this ray, both with its own holograms and with the spatial mapping mesh to determine what virtual or real-world object your user may be looking at.

HoloLens根据使用者的位置和朝向决定凝视的方向向量,而不是眼睛。你可以想象成从你的两眼之间朝前射出一条激光指示器。当你在房间里到处瞅的时候,应用(内的虚拟对象)能与这条射线产生交错,从而决定你正在看着的是虚拟或者真实对象。


3.On HoloLens, interactions should generally derive their targeting from the user's gaze, rather than trying to render or interact at the hand's location directly. Once an interaction has started, relative motions of the hand may be used to control the gesture, as with the manipulation or navigation gesture.

在HoloLens里面,交互行为一般先要从使用者的凝视点获取目标,而不是直接从手势交互开始。一旦凝视交互开始,你就可以用手势来交互了,比如manipulation 或 navigation 手势。


A.Uses of gaze :使用凝视

  • Your app can intersect gaze with the holograms in your scene to determine where the user's attention is.
  • 能够与场景中凝视的全息影像互动,从而决定你的关注点。
  • Your app can target gestures based on the user's gaze, letting the user select, activate, grab, scroll, or otherwise interact with their holograms.
  • 手势将基于你的凝视,使用户能够选取,激活,抓取,滑动或其他与全息影像的交互。
  • Your app can let the user place holograms on real-world surfaces, by intersecting their gaze ray with the spatial mapping mesh.
  • 能够将全息影像放置于凝视射线与空间映射网格交汇的真实世界表面之上。
  • Your app can know when the user is not looking in the direction of an important object, which can lead your app to give visual and audio cues to turn towards that object.
  • 当用户未看到主要的对象时,可以用一个可视化的引导或者声音提示用户转向这个重要的对象。

B.Cursor : 光标
Most apps should use a  cursor  (or other auditory/visual indication) to give the user confidence in what they're about to interact with. You typically position this cursor in the world where their gaze ray first interacts an object, which may be a hologram or a real-world surface.
大多数的应用会使用光标(或其他可听的或可视化的指示)来告诉你将会与什么交互。光标在世界中的位置,会告诉你凝视射线第一个交互的到底是全息影像还是真实世界表面。

C.Giving action to the user's gaze : 给予凝视对象行为
1. Once the user has targeted a hologram or real-world object using their gaze, their next step is to take action on that object. On HoloLens, the primary ways for a user to take action are through  gestures  or  voice .
一旦你将全息影响或真实世界对象用凝视选取为目标。下一步操作就是让对象产生行为。在HoloLens里面,最主要的方式就是通过使用者的手势或语音来控制。


See also

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
本篇学习笔记主要讲解 HoloLens 2 开发入门教程中的 MRTK(Mixed Reality Toolkit)的 EyeTracking 和语音识别功能。 ## EyeTracking HoloLens 2 中的 EyeTracking 功能可以让应用程序能够检测用户的注视点,并根据注视点来响应相应的操作。MRTK 提供了一些组件来支持 EyeTracking 功能。 ### GazeProvider GazeProvider 是一个 MRTK 组件,它可以检测用户的注视点,并在场景中放置一个 Gaze Cursor(注视光标)来指示用户的注视点。要使用 GazeProvider,需要将它添加到场景中的一个物体上。 ### EyeTrackingTarget EyeTrackingTarget 是一个 MRTK 组件,它可以将一个物体标记为 EyeTracking 的目标。当用户的注视点在该物体上时,可以触发相应的操作。要使用 EyeTrackingTarget,需要将它添加到场景中的一个物体上,并设置它的 Trigger Type(触发类型)和 Action(操作)。 ### 示例 以下代码演示了如何在 HoloLens 2 上使用 EyeTracking 功能: ```csharp using UnityEngine; using UnityEngine.XR.WSA.Input; using Microsoft.MixedReality.Toolkit.Input; public class EyeTrackingExample : MonoBehaviour { private GazeProvider gazeProvider; private GameObject targetObject; void Start() { gazeProvider = FindObjectOfType<GazeProvider>(); targetObject = GameObject.Find("TargetObject"); } void Update() { if (gazeProvider.GazeTarget != null && gazeProvider.GazeTarget == targetObject) { Debug.Log("Gaze detected on target object."); } } } ``` ## 语音识别 HoloLens 2 中的语音识别功能可以让应用程序能够识别用户的语音指令,并根据指令来响应相应的操作。MRTK 提供了一些组件来支持语音识别功能。 ### SpeechInputHandler SpeechInputHandler 是一个 MRTK 组件,它可以将一个物体标记为语音输入的目标。当用户说出相应的语音指令时,可以触发相应的操作。要使用 SpeechInputHandler,需要将它添加到场景中的一个物体上,并设置它的 Keywords(关键词)和 Actions(操作)。 ### 示例 以下代码演示了如何在 HoloLens 2 上使用语音识别功能: ```csharp using UnityEngine; using Microsoft.MixedReality.Toolkit.Input; public class SpeechInputExample : MonoBehaviour, IMixedRealitySpeechHandler { public void OnSpeechKeywordRecognized(SpeechEventData eventData) { if (eventData.Command.Keyword == "Hello") { Debug.Log("Hello command recognized."); } } } ``` 需要注意的是,在使用语音识别功能之前,需要先在 MRTK 的配置文件中启用语音识别功能,并添加相应的语音指令。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值