Hello everyone.

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.

Spatial mapping HELP

edited September 2016 in Questions And Answers

Hi guys, I follow the tutorial Holograms 101 with my own model.
I did this instructions:

-In Unity, click on the Holograms folder in the Project panel.
-Drag the Spatial Mapping asset into the root of the Hierarchy.
-Click on the Spatial Mapping object in the Hierarchy.
-In the Inspector panel, change the following properties:
-Check the Draw Visual Meshes box.
-Locate Draw Material and click the circle on the right. Type "wireframe" into the search field at the top. Click on the result and then close the window. When you do this, the value for
-Draw Material should get set to Wireframe.
-Export, build and deploy the app to your HoloLens.
-When the app runs, a wireframe mesh will overlay your real world.
-Watch how a rolling sphere will fall off the stage, and onto the floor!

But I'm not able to see the wireframe mesh as a overlay in the real world.
Can anyone help me please?

Thanks in advance!

Best Answers

Answers

  • ahillierahillier mod
    edited September 2016

    Hi @AylinCopoglu,
    What version of Unity are you using? The class instructions should work when running with 5.4.0f1, f2, or f3. However, if you have already updated to the Unity 5.5 beta build, then you might see some errors in Unity's console window and you'll need to edit the SpatialMapping.cs file (customMaterial should be changed to visualMaterial, and RendererSettings should be changed to renderState).

    The wireframe material is actually set by default on the Spatial Mapping component, so you just need to check the 'Draw Visual Meshes' box in order to see the wireframe:

    If you don't see the wireframe mesh when running on the HoloLens, do you still get collisions? If you make a sphere drop, does it roll around on the floor? This would indicate that the 'Draw Visual Meshes' box in not checked or that the occlusion material is being used instead. If you happen to see a pink mesh instead of the wireframe, then the material failed to load. If you don't get collisions or see pink, then:
    1) Make sure that an older version of your application is not already running on the device before you deploy (if you use the Windows Device Portal, you can go to the 'apps' page and then stop the app from running by pressing the 'X' button next to 'Origami' in the 'Running Apps' section). Sometimes an app won't be updated on the HoloLens if it is still running.
    2) Double-check that you pressed the 'Reload All' button when switching back to Visual Studio after building in Unity. If you forgot to do this, simply rebuild from Unity again and then press 'Reload All' in VS after the build completes. This will update VS with the latest changes made in Unity.

    You can also try loading one of the catch-up chapters that were downloaded with the project if you can't get the settings to work properly in your project.

    Let me know if this helps,
    ~Angela

  • I have the version 5.4.0b22-HTP Personal

  • @AylinCopoglu did you enable the spatial perception capability in the player settings?

    ===
    This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.

    (Daddy, what does 'now formatting drive C:' mean?)

  • edited September 2016

    **I can't see the wireframe mesh, there is no collisions. I don't have the stage or sphere, because I use my own model. **

    Click on the Holograms folder in the Project panel. OK
    Drag the Spatial Mapping asset into the root of the Hierarchy. OK
    Click on the Spatial Mapping object in the Hierarchy. OK
    In the Inspector panel, change the following properties:
    Check the Draw Visual Meshes box. OK
    Locate Draw Material and click the circle on the right. Type "wireframe" into the search field at the top. Click on the result and then close the window. OK
    Export, build and deploy the app to the HoloLens emulator. OK
    When the app runs, a mesh of a previously scanned real-world living room will be rendered in wireframe. I can't see that
    Watch how a rolling sphere will fall off the stage, and onto the floor! I don't have a rolling sphere because I use a car, its my own model
    Now we'll show you how to move the OrigamiCollection to a new location:

    In the Scripts folder, create a script named TapToPlaceParent. OK
    In the Hierarchy, expand the OrigamiCollection and select the Stage object. I don't have a Stage object
    Drag the TapToPlaceParent script onto the Stage object. I drag an drop it into my car

    and it doesn't work :(

  • For tap to place parent to work, you'll need to have an empty game object and make the car a child of the empty object. Otherwise tap to place won't work. You also need to make sure that the colliders were imported with your model.


    ===
    This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.

    (Daddy, what does 'now formatting drive C:' mean?)

  • Thanks! How can I make the car a child of the empty game object?

  • @Patrick said:
    1. make an empty game object in the hierarchy (create -> Create empty)
    2. Drag the car from the project panel to the empty game object you just made

    Thanks I made it. Now I'll try again the tapToPlace..

  • Since I don't have a Stage object, where should I drag the TapToPlaceParent script?

  • Answer ✓

    Menu: Edit > Project Settings > Player
    OR
    Though the build window at the bottom "Player Settings"

    Stephen Hodgson
    Microsoft HoloLens Agency Readiness Program
    Virtual Solutions Developer at Saab
    HoloToolkit-Unity Moderator

  • @stephenhodgson said:

    Menu: Edit > Project Settings > Player
    OR
    Though the build window at the bottom "Player Settings"

    Thanks!

  • Thanks guys, I did everything but since I don't have a Stage object, where should I drag the TapToPlaceParent script?

  • On the empty game object you created :) That is essentially your "stage"

  • @Jesse_McCulloch said:
    On the empty game object you created :) That is essentially your "stage"

    Thanks!

  • Ok guys, the wireframe mesh overlayed the real world, but I can see the both cars.... also if I tap to the car, it doesnt place .... HELP PLEASE :(

  • Hi
    @AylinCopoglu I had a similar problem, but now it's working.

    @Patrick when you say " You also need to make sure that the colliders were imported with your model."
    I don't find in Player Settings, the "Generate Colliders" but I would like to know.
    Anyway I worked around this using a box collider around my model and it works though sometimes the hologram does not move with gaze when I trying to place it and sometimes gets occluded by the mesh, do have any idea what is happening?

    Thanks!

Sign In or Register to comment.