You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Hololens2中UWP应用位置迁移与跟随用户功能实现的技术咨询

Hey there! Let's break down your two HoloLens 2 UWP questions with clear, actionable steps:

1. How to Migrate the Installation Location of a UWP App on HoloLens 2

Moving a UWP app's storage location on HoloLens 2 depends on whether you prefer local device actions or remote management. Here are two reliable methods:

  • Option 1: Local Device Settings (No PC Required)

    • On your HoloLens 2, open Settings > System > Storage
    • Scroll through the list of installed apps to find the one you want to move, then tap it
    • Select the Move option, choose your target storage drive (this works if you have an external USB drive connected), and confirm the action.
      Note: Not all apps support moving—this depends on how the app was packaged. Some system-dependent apps are locked to internal storage.
  • Option 2: Remote Management via PowerShell

    • First, enable PowerShell access on your HoloLens 2: Go to Settings > Update & Security > For developers, toggle on Device discovery and allow PowerShell connections.
    • On your PC, open PowerShell as an administrator, then connect to your HoloLens using its IP address:
      Enter-PSSession -ComputerName <Your-HoloLens-IP> -Credential <HoloLens-Username>
      
    • Once connected, list all installed apps to get the app's full package name:
      Get-AppxPackage
      
    • Use this command to move the app (replace placeholders with your app's details):
      Move-AppxPackage -Package <App-Package-Full-Name> -DestinationFolder <Target-Storage-Path>
      
2. Making a UWP App Follow the User Like the HoloLens 2 System UI

This is absolutely feasible in the UWP framework! The system UI (like the Start menu) stays anchored to your field of view by binding to the head coordinate system instead of a fixed spatial point. Here's how to replicate this behavior:

  • Full App Fixed Screen Space

    • To make your entire app's content follow the user's head movement, enable fixed screen space in your app initialization code (e.g., in App.xaml.cs):
      var holographicView = HolographicView.GetForCurrentView();
      holographicView.IsFixedScreenSpace = true;
      
    • This setting ties your app's render frame directly to the user's head pose, keeping it centered in their view just like the native system UI.
  • Targeted UI Element Tracking

    • If you only want specific UI elements to follow the user (not the whole app), use SpatialLocator to dynamically update the element's position based on real-time head tracking:
      var locator = SpatialLocator.GetDefault();
      // Create a frame of reference tied to the user's current head position
      var headCoordinateSystem = locator.CreateStationaryFrameOfReferenceAtCurrentLocation().CoordinateSystem;
      // Bind your UI element's transform properties to this coordinate system
      
    • You'll need to update this coordinate system each frame to ensure smooth, real-time tracking.
  • Key Considerations

    • Persistent UI can feel intrusive—add a toggle for users to enable/disable this behavior if needed.
    • Test in different environments to ensure tracking is smooth and doesn't cause motion discomfort.

内容的提问来源于stack exchange,提问作者Xiink

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.30 11:22:44