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.

Align to surface normal

Hi! I am developing with holotoolkit, I am placing object with SpatialMappingObserver, SpatialMappingManager and WorldAnchorManager like managers, and the objects I want to place they have "TapToPlace"

My cuestion is: When I am placing one object, this object is face to face with camera and works nicely with spatial surfaces, that is OK. But the thing I want to do: When the object (for example a plane) touch a wall, I want this plane aligns with the wall normal.

I cant find the script for this. When I run microsoft app and I am positioning the window, this window works that I am asking for. I want for my scene planes. I appreciate the help!!
Regards.

Answers

  • Hi @gomes

    I think basically you just want to set your transform.up vector to match the normal of the surface you are putting it on. The spatial mapping mesh might be a little noisy to use directly; using plane finding would be better. There is some good discussion here though it isn't HoloLens specific.

  • Thanks for your help, my problem is that I dont know how and where catch this spatial surface for acces to his normal.

  • GazeManger.Instance.Normal will give you the normal of the surface that your gaze intersects with.

  • I think I know what you want. Use serfacemeshestoplanes script, generate planes in your environment, then place objects on those planes. You can get some help from holograms 230. (Placeable script)

    Hey, I'm a Microsoft Student Partner and a Mixed Reality Project Manager at a game development studio. I'm here to inspire and get inspired. Cheers.

Sign In or Register to comment.