Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronizing Coordinate Systems in Holographic Remoting #144

Open
xyq3q opened this issue Sep 30, 2024 · 1 comment
Open

Synchronizing Coordinate Systems in Holographic Remoting #144

xyq3q opened this issue Sep 30, 2024 · 1 comment

Comments

@xyq3q
Copy link

xyq3q commented Sep 30, 2024

Hi,

Your work is truly commendable, and I appreciate your efforts.

I have integrated hl2ss into the Holographic Remoting Sample Player and am using Unity for remote rendering. I am curious about how to synchronize Unity's coordinate system with that of hl2ss. I am aware of using UpdateCoordinateSystem() in UWP applications, but I'm unsure how to implement this in Holographic Remoting. I look forward to your guidance on this matter.

Best regards

@jdibenes
Copy link
Owner

Hi,

I cannot test this right now so I'm not sure it will work but:

  1. Uncomment #define ENABLE_USER_COORDINATE_SYSTEM_SAMPLE in SamplePlayerMain.h
  2. In SamplePlayerMain.cpp, in SamplePlayerMain::Initialize (lines 433-434) change m_userSpatialFrameOfReference = m_spatialLocator.CreateStationaryFrameOfReferenceAtCurrentLocation(float3(0.5f, 0.0f, -2.0f), quaternion(0, 0, 0, 1), 0.0); to m_userSpatialFrameOfReference = m_spatialLocator.CreateStationaryFrameOfReferenceAtCurrentLocation();
  3. In SamplePlayerMain.cpp in SamplePlayerMain::SetWindow after InitializeStreams (hl2ss) add OverrideWorldCoordinateSystem(winrt::get_abi(m_userSpatialFrameOfReference.CoordinateSystem()))

This is based on https://learn.microsoft.com/en-us/windows/mixed-reality/develop/native/holographic-remoting-coordinate-system-synchronization-wmr
I'm hoping Unity internally calls m_remoteContext.GetUserSpatialFrameOfReference(); (or equivalent) when remoting, but I don't know if that's the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants