The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
Holograms 230 Chapter 1 no room mesh displayed
Hi,
I'm going through Chapter 1 and when I add my room .obj file to the Object Surface Observer and hit Unity play, I just see a blank black screen. I tried building and deploying to the emulator from Visual Studio and I see the default mesh but not my room mesh. I'm running 64bit Unity 5.4.0b18 HTP on a 64bit Windows 10 system with Visual Studio 2015 Update 2. Other tutorials I've tried have worked fine. I've tried with two different versions of the download .zip, from GitHub and from the tutorial page. Any suggestions would be greatly appreciated.
I have checked to make sure my .obj file actually has the room model and it does. I can open it in MeshLab.
Thanks!!
Best Answers
-
OptionsDavidKlineMS mod
@Voxel,
The code in Holograms 230 only loads the Object Surface Objserver's mesh in the Unity editor. On HoloLens (and in the emulator), the project uses the live Spatial Mapping data.Thanks!
David5 -
Optionsahillier mod
@Voxel,
While scanning from the Windows Device Portal, make sure that you can see surfaces rendered in the display view before pressing the save button (press 'Update' multiple times until all of your scanned surfaces appear).As David mentions above, the SRMesh should only load while in the Unity Editor. You should be scanning real surfaces with the device and pre-load one of the rooms that come with the Emulator before running the class there. If you dragged the SRMesh object into your hierarchy to view it in the scene, then you should disable it before deploying to the device.
The coordinates (0,0,0) is the location of the camera (HoloLens) when the application first launches. This will be considered the center of the holographic world. When you move from that location, you are no longer at the center of the world. Since you can move around, the center of the world can be different with each fresh deploy of your app.
There should be a 'Completed' project folder included in your file download for the course. Within the Assets folder of that project, you will find an SRMesh file that you can use to double-check that everything is working. Be sure that the 'Object Surface Observer' has the SRMesh set as it's 'Room Model' or else nothing will be loaded.
6
Answers
@Voxel is the "Draw Visual Meshes" checkbox checked on the Spatial Mapping Manager?
Windows Holographic User Group Redmond
WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
WinHUGR YouTube Channel -- live streamed meetings
@HoloSheep Yes, the Draw Visual Meshes box is checked. I do see a bunch of warnings that look like:
VR: Hololens could not be loaded: Failed to load symbol CreateHolographicSpace.
VR: Hololens could not be loaded: Failed to load symbol GetConnectionState.
VR: Hololens could not be loaded: Failed to load symbol PerceptionRemotingSetEnableSpeech.
There are a few more similar warnings.
@Voxel I believe those warnings are benign.
The one other suggestion I would offer is that you might want to unzip another version and before you open it shorten the path names as much as reasonably possible and try opening that shortened path version of the project in Unity.
Unity does (or some of the tools used by Unity) have issues with long paths and spaces in paths and file names.
BTW. It is also a good idea to unblock the zip file from the properties page before extracting the contents.
Windows Holographic User Group Redmond
WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
WinHUGR YouTube Channel -- live streamed meetings
@HoloSheep I tried what you suggested. Same outcome. Both your suggestions about shortening path and unblocking zip before extracting content
@neerajwadhwa ok thanks.
It looks like the .obj file saved from the Hololens and added to the SpatialMapping object does not have a mesh which causes it to not render, hence the black screen. Line ~ 33 in ObjectSurfaceObserver.cs
foreach (MeshFilter filter in roomFilters)
never runs . Debug output showsroomFilters.Length = 0
. I looked at the .obj file in MeshLab and it shows a mesh so I'm not exactly sure why the same model does not show a mesh in Unity.When I replace the saved .obj file with just a simple Unity cube, the roomFilters.Length = 1. Other things like finding horizontal/vertical planes fail for the cube as expected but at least there is a mesh there.
Any thoughts on what may be happening?
I RecalculateNormals() on the .obj model saved from the Hololens and also changed its Z value to force it to be in front of the camera. I don't think I should need to do those things to make the model visible but that seems to fix things at least in the Unity Editor where I can now see the room model in when I hit Play. However, I see nothing in the emulator after I build the solution and run it.
I tried on the device and didn't see my mesh load. It just started scanning again which may be because there were not enough horizontal/vertical planes found perhaps. So I'm curious to know why the loaded model shows up behind the camera in Unity by default. What does the unity world (0,0,0) correspond to in the real room/Hololens?
@Voxel,
The code in Holograms 230 only loads the Object Surface Objserver's mesh in the Unity editor. On HoloLens (and in the emulator), the project uses the live Spatial Mapping data.
Thanks!
David
@Voxel,
While scanning from the Windows Device Portal, make sure that you can see surfaces rendered in the display view before pressing the save button (press 'Update' multiple times until all of your scanned surfaces appear).
As David mentions above, the SRMesh should only load while in the Unity Editor. You should be scanning real surfaces with the device and pre-load one of the rooms that come with the Emulator before running the class there. If you dragged the SRMesh object into your hierarchy to view it in the scene, then you should disable it before deploying to the device.
The coordinates (0,0,0) is the location of the camera (HoloLens) when the application first launches. This will be considered the center of the holographic world. When you move from that location, you are no longer at the center of the world. Since you can move around, the center of the world can be different with each fresh deploy of your app.
There should be a 'Completed' project folder included in your file download for the course. Within the Assets folder of that project, you will find an SRMesh file that you can use to double-check that everything is working. Be sure that the 'Object Surface Observer' has the SRMesh set as it's 'Room Model' or else nothing will be loaded.
@DavidKlineMS That helps clarify so many things! Thank you.
@ahillier I did see the surfaces rendered before I hit Save but I will try again and also test out the Completed project. Thanks for answering the coordinate question.
I have asked a follow-up question here:
https://forums.hololens.com/discussion/2938/position-independent-object-placement