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.

Hologram to face the user

I am trying to implement a holographic screen, which should face the user as soon as the user is stationary at a position.
In the implementation, when the user is moving, the hologram should NOT continuously change orientation to face the user. However, as soon at the user stops moving, and fixes position, the hologram should now orient to user's direction, facing the user. I went through bill boarding to implement this. I would like to know if bill boarding continuously reorients holograms to face the user; or does so only when user becomes stationary at a position?

Thanks in advance!
John

Answers

  • stepan_stulovstepan_stulov ✭✭✭
    edited June 2017

    Hey, @John_Smith1

    There are two parts to your problem.

    1. You want to know when the user is stationary. I'm not sure if by that you meant simply not moving or stepping onto a landmark of some sort. In the first case you simply have to track the velocity (and rotation if you also want the user to not turn the head) of your main camera and see if has been low enough for long enough. Our heads constantly shake, so you can't compare to zero, you will have to play with some thresholds. In the second case you will have to have a landmark, perhaps anchored with a WorldAnchor, supplemented with an isTrigger=true collider (most practically a very tall capsule) and also your camera supplemented with a collider and a rigidbody. Once the enterer enters the enteree, the OnTriggerEnter function of your script attached to the main camera will be called. This is exactly the moment you want.
    2. Billboarding. Billboarding is orienting an object onto camera. There are different techniques such as exact billboarding, billboarding "on a pole", etc. You'd usually simply call LookAt() method of your billboard's transform or otherwise use Quaternion.LookRotation() to produce a rotation to assign to the billboard's transform. Now, when to reorient is up to you. You can do that on Update() so it happens continuously. You can do that in your OnTriggerEnter() so it happens only when stepping on landmarks. You can also smoothen the experience so that you billboard looks at an invisible point that smoothly follows the user.

    Building the future of holographic navigation. We're hiring.

  • Hi Stepan_Stulov,

    Thank you for your detailed response.

    I understand from your points above that it is possible to produce rotation to cause hologram face the user, at a trigger, and the trigger can be when the user stops moving. In this manner, the holograms will face the user when he/ she stops.

    Please confirm if it is appropriate to implement the OnTriggerEnter() in place of Update in the script at source: https://github.com/Microsoft/HoloToolkit-Unity/blob/master/Assets/HoloToolkit/Utilities/Scripts/Billboard.cs ?

    Also, any source link which explains such an implementation or use of trigger for billboard would be highly appreciated!

    Thanks again,
    Regards,
    John

  • stepan_stulovstepan_stulov ✭✭✭
    edited June 2017

    @John_Smith1

    No, you'd rather adjust the Billboard script so that it doesn't
    continuously look at the camera but only when some kinda of isLooking flag is set to true so you can choose when to billboard.

    And then you will implement your stationarity detection system which will either be a stopping self detection camera or camera with landmarks, depending on which you want.

    Finally you will wire the events of the camera starting and stopping stationarity with enabling and disabling your billboards' isLooking flag.

    This is all just a suggested architecture, it's up to you at the end of the day.

    PS: Things to keep in mind if you go the landmarks path:

    1. The enteree's collider has to have its isTrigger set to true in order to receive the onTriggerEnter message
    2. The enterer's rigidbody has to have its isKinematic set to true in order for physics to not affect your camera.

    More in this thread:
    https://forums.hololens.com/discussion/comment/14772#Comment_14772

    Building the future of holographic navigation. We're hiring.

Sign In or Register to comment.