Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use HoloToolkit components in Hololens

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article is to share with you about how to use HoloToolkit components in Hololens, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.

There are six main categories of HoloToolkit: Input,Sharing,SpatialMapping,SpatialSound,Utilities,Build. I will mainly elaborate on the role and use of components in common categories of resources.

(1) Input resources provide many basic components: HoloLensCamera,InputManager,Cursor (commonly used Cursor and CursorWithFeedback).

InputManager.prefab: input manager, which is used to manage input sources such as line of sight, gestures, etc. This manager also provides the ability to simulate input in the editor: Shift: left hand, Space: right hand, mouse movement: simulated hand movement, left mouse button: simulated hand click, right mouse button: simulated line of sight movement, WSAD/QE: camera movement.

Cursor.prefab: the toolkit comes with one of the cursors, which mainly realizes that when staring at an object, there is an attached ring, otherwise the cursor lights up.

The other ones come with cursors as follows:

BasicCursor.prefab: base cursor, staring at the object with an attached ring, otherwise it will not be displayed.

Gaze objects and non-gaze objects

CursorWithFeedback.prefab: the gesture detection cursor becomes a gesture icon when the hand is detected.

DefaultCursor.prefab: default cursor, which simulates the built-in cursor of the Hololens system.

After talking about so many components, refer to the example of Hololens Academy, before you start functional development, you need to configure common components and drag them directly from Prefab in Input resources to the panel, as shown in the figure.

The Recognizer Start has voice commands corresponding to Auto Start and Manual Start,Keyword, and the response object and method are set in the Response () panel.

Note: if there is a voice command, but there is no response? Reason: check the above steps for omissions. When debugging with Holographics Remoting Player, if you have an external microphone, please try to speak with an external microphone. Please check the Microphone function.

(4), Spatial Sound (spatial sound)

Use the sound plug-in in Unity to implement spatial sound. The plug-in (audio spatalizer plugin) is packaged into Unity, as long as you enable the Microsoft HRTF extension in Edit- > Audio- > Spatializer in the settings menu.

Spatial sound can be used in Unity by adjusting the three properties of the Audio Source component. The steps are as follows: 1. In the panel, select an object with an Audio Source component; 2. In the inspection panel, modify the properties of the Audio Source component: select the Spatialize property (adjust the 3D effect of sound); set the Spatial Blend mode to 3D; expand 3D Sound Settings and set the Volume Rolloff (volume attenuation mode) to Custom Rolloff

(5), spatial mapping (Spatial mapping)

Find SpatialMapping.prefab and drag to the root panel. Find WorldAnchorManager.cs to attach to GameObject, and then attach TapToPlace.cs to GameObject.

Where SpatialMapping.prefab is the built-in space mapping component

WorldAnchorManager.cs is the built-in spatial coordinate manager

TapToPlace.cs is a script that clicks and places objects into space.

(6), shared hologram (Sharing holograms)

In order to realize that multiple people in the same room can see "the same object", it is necessary to share the hologram and other information such as the spatial location of the hologram. To achieve this effect, there are the following points to note:

1. You need to enable the Spatial Perception function of the device (check in Publishing Settings- > Capabilities in the Player Setting panel)

2. The network function of the device needs to be enabled.

3. Currently, you can only test on more than two real machines, but not in Unity (even if Remoting is connected to Hololens)

4. The equipment is in the same room

Shared holograms are mainly realized by the following technical ways:

1. Use Socket protocol to transfer data

2. Understand the world coordinate system and the use of spatial anchors (WorldAnchor and WorldAnchorStore)

3. The use of Sharing components (upload and download of anchor points)

The above is how to use HoloToolkit components in Hololens. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report