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
- LUT assets are not shown when selecting Spectral Lut with Advanced Object Selector
- GameObjects disappear from Scene view when hidden in Hierarchy and Scene view Eye icon is disabled with GPU Resident Drawer enabled
- [Android] Audio sound is lower in the Player compared to the native music player
- Feet slide and misalign when playing retargeted animations
- IndexOutOfRangeException is thrown in NativePassCompiler when a graphics buffer is used in more than 5 render passes
This is a duplicate of issue #1207427