Search Issue Tracker
Duplicate
Votes
0
Found in [Package]
1.0.19
Issue ID
1216994
Regression
No
Cannot retrieve photo location data (CamToWorld and Projection matrices) on HoloLens 2 via Unity.XR SDK
We are currently porting our HoloLens 1 application to support using HoloLens 2. The application has a 2D-Whiteboard which displays an image taken with the HoloLens RGB Camera via Unity.XR.WSA.WebCam.PhotoCapture (https://docs.microsoft.com/en-us/windows/mixed-reality/locatable-camera-in-unity). When taking the photo we save the location data (CamToWorld and Projection matrices) by calling:
photoCaptureFrame.TryGetCameraToWorldMatrix(out c2wMatrix);
photoCaptureFrame.TryGetProjectionMatrix(out projMatrix);
On HoloLens 1 everything works fine and we are using the matrices to project annotations (freehand drawings, circles, etc.) made on the 2D-Whiteboard into the 3D world to create spatial annotations.
Now, when using the same code compiled for ARM on HoloLens 2 we are not able to get location data. Calling photoCaptureFrame.TryGetCameraToWorldMatrix(out c2wMatrix) or photoCaptureFrame.TryGetProjectionMatrix(out projMatrix) always returns false and we are getting back identity matrices. For the moment we are stuck porting this functionality to HoloLens 2.
I have created a minimal Unity project with one script that takes a photo on HoloLens via Unity.XR.WSA.PhotoCapture SDK and attached it to reproduce this issue.
Steps to reproduce:
1. Open the attached Unity project and build "Sample Scene" for UWP for x86 and ARM
2. Build generated x86 project in Visual Studio and deploy on HoloLens 1 => see correct values in logged CamToWorldMatrix and ProjectionMatrix
3. Build generated ARM project in Visual Studio and deploy on HoloLens 2 => see wrong values in logged CamToWorldMatrix and ProjectionMatrix (identity matrix, because retrieving location data do not work)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- UnityYamlMerge.exe doesn't correctly handle merge conflicts in modified properties on a prefab variant
- Inconsistent color scheme in "Details" section of "Select Presets" inspector window
- Crash on __pthread_kill when launching Editor via command-line with "-disableManagedDebugger" argument
- [VFX] Deleting “New Group Node” name doesn’t allow to type or add new name
- [VFX] Creating a long Group Node name breaks nodes boarders
This is a duplicate of issue #1207427