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.

Holograms 210 Ch. 2 help

I just got through ch 2 of holograms 210 where I create a cursor that is affected by the hologram. The problem is that the cursor just travels through the hologram, which is not the one used in the demo but part of the app I am developing. it just stays at the same distance no matter what. How can I fix this?

Best Answer

Answers

  • SpheredCazualSpheredCazual ✭✭
    edited October 2016

    Do your own gameobject /holograms have colliders attached have a look at the unity help page https://docs.unity3d.com/ScriptReference/Physics.Raycast.html it explains that a raycast needs a collider to see if it hit the gameobject.

    I am pretty sure if you add a collider (box or something fitting) it will work

    btw in the Gazemanager script the line shows how the cursor achieves a hit (line 72-86 in chapter 210

    Hit = Physics.Raycast(gazeOrigin,
                       gazeDirection,
                       out hitInfo,
                       MaxGazeDistance,
                       RaycastLayerMask);
    

    creative mind, free thinker, dreamer, maker, mostly working on games and doodling around with gadgets, Sphered Cazual/Elite/Master of the Universe/Dad/Husband @mariovermeulen

  • @SpheredCazual said:
    Do your own gameobject /holograms have colliders attached have a look at the unity help page https://docs.unity3d.com/ScriptReference/Physics.Raycast.html it explains that a raycast needs a collider to see if it hit the gameobject.

    I am pretty sure if you add a collider (box or something fitting) it will work

    btw in the Gazemanager script the line shows how the cursor achieves a hit (line 72-86 in chapter 210

    Hit = Physics.Raycast(gazeOrigin,
                       gazeDirection,
                       out hitInfo,
                       MaxGazeDistance,
                       RaycastLayerMask);
    

    wouldn't a box collider just create a box shape around the object for the cursor to follow? I kind of need the cursor to follow along the model. Basically, what I'm trying to do is create a presentation for my vehicle where the interface is set up similar to HoloTour, in that if you look at a specific component of the vehicle for long enough of a time, the voice of the Virtual Intelligence System for the vehicle will begin to explain the component. In addition, he would also start pointing out components you haven't seen if nothing new is discovered for long enough. What is the best scenario to achieve this?

  • @SpheredCazual said:
    There are a couple of ways to achieve this one is for each component of your model adding multiple primitive colliders, or use a mesh collider, although mesh colliders are expensive for collision resolution and ray casting (the impact would appear in Physics). Mesh colliders are also subject to back face culling and need to be convex to collider with each other.
    Your best bet would be to approximate the shape of the components of your hologram using multiple primitive colliders.

    Have a look at the astronaut model in the hologram academy and see how they added colliders to different part of him to collide with and react to different areas on the astronaut, look specifically at Astroman/GEO_G/GEO_CENTER/* specifically at Chestbutton_center where they have even added a action script to have interaction when you select (note the two box colliders to make up the shape of the button

    Okay, so I just added the colliders. some I had to do mesh, others I could get away with boxes. now, the problem is that for the mesh colliders, the cursor does change to the position of the mesh, but the cursor position is so close to the mesh that its basically right behind the surface. I can only see the cursor flickering in at points. Which part of code can I change to make the position of the cursor the position of the object -0.05?

  • SpheredCazualSpheredCazual ✭✭
    edited October 2016

    @WEDimagineer You can in the editor edit the collider and make it slightly bigger than your object so the cursor will float in front of it, however I am not sure how you could do this with the mesh collider (no edit button in the editor) maybe programmatically? Otherswise try and use a Polygon collider instead of the mesh collider?

    creative mind, free thinker, dreamer, maker, mostly working on games and doodling around with gadgets, Sphered Cazual/Elite/Master of the Universe/Dad/Husband @mariovermeulen

Sign In or Register to comment.