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.

Manipulating Objects with the HoloLens

Hi,
So I'm relatively new to both the HoloLens and unity.

What I'm trying to do is write a script that allows me to manipulate a hologram. Scale, rotation, that kind of stuff.

The way I'm doing this is loading in some model, and then drawing little spheres around it in basically a bounding box.

Each of the little bounding spheres are instantiated with an input script attached to them. I'm using the IManipulationHandler (system?) to manipulate stuff.

So, the way it should work is that I click one of the bounding spheres and drag to, for example, rotate the parent model around the Y axis.

Now this actually works, BUT, when the cursor falls off the sphere, dragging stops working. So I can, for example, rotate it as long as the cursor is over the given bounding sphere, but as soon as it stops hitting it I can't rotate anymore.

What I want is for this to not happen. I want to be rotating as long as I'm clicked down.

I've been trying various ways to fix this and I'm not really getting anywhere. I could use some help, thank you.

Here's some example code from the manipulation script attached to the bounding spheres

public void OnManipulationUpdated(ManipulationEventData eventData)
{

            //Click and drag any of these spheres to rotate about the z axis 
    if (XY.Contains(this.gameObject)) 
    {
        this.GetComponent<Renderer>().material.color = Color.blue;
        model.transform.eulerAngles += new Vector3(0,0,  -eventData.CumulativeDelta.z * rotateRate); //Rotate about model Z 
    }

    }
Tagged:

Answers

Sign In or Register to comment.