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.
Options

How does hololens define the plane surface and wall of the worldspace

I am looking to the Microsoft HoloLens: Course 230 - Spatial Mapping - Ch. 3 - Visualization
(https://www.youtube.com/watch?v=RnkvXl-aXD4&t=241s)
This chapter of the course is about how to apply the shaders the room model, and I can understand if the surface is normal to a plane, then it should the wall. But how does the hololens recognize that a plane is a ground surface of the room?

Tagged:

Best Answer

Answers

  • Options

    @Dwight_Goins_EE_MVP said:
    This is a basic 3D geometry and linear math question you're asking. Typically the surface normal is the vector that points back towards the camera when the camera is pointed at the surface. The World+View+Projection (WVP) matrix contains floats that have projections in world space, + view space + camera space. In each of these floats there is an "UP" vector that tells the shader which way is up. Thus what ever is considered as "UP" the opposite of that is down aka the floor.

    In the example above the pixel (VertToFrag) shader is being passed in a vectors for View, Surface Normals, and World. Using linear math as long as you have at least 2 axis (in this case vectors) that are perpendicular to each other, and you've chosen an handedness (Right hand or Left hand) you can always determine the "UP" vector by just multiplying.

    However you'll notice Unity supplies the UP vector already in the MVP (model view project) matrix in the vertex shader (UNITY_MATRIX_MVP).

    Thanks man, you rock!

Sign In or Register to comment.