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
- UI Toolkit 'background-size' property is not fully animatable
- Moving the Scrollbar via clicking no longer works after the first-click when page size is too small
- Elements in UI Builder Viewport are displayed incorrectly when Editor UI Scaling is set to 125%
- Prefab referencing a script is not shown in the Search window's Project tab when using "Find References In Project"
- Scroll view sensitivity remains unchanged when modifying the "--unity-metrics-single_line-height" value
This is a duplicate of issue #1207427