#Hololens – How to select an hologram, change size or position and more using #MRDesignLab

Hi!

Another cool feature we can add to our Mixed Reality Apps using the assets shared by the Mixed Reality Design Labs is

Add the feature to select an hologram, change size, change position (in 3D mode) or even remove the hologram in a scene.

This is very similar of what we do with the sample App included in the Hololens with the Hologram Gallery. The next image shows a sample of this scenario.

2017 08 07 Holo MRDesignLab Move Resize Holograms 02

As you can see we have the select action, the action menu and more.

So, once we have added the MRDesign Labs assets to our project, and we added the Hololens prefab to have the main features available for us, we will add a Capsule element to our scene. In order to do this, we need to add a Collection to “host” this elements, let’s go the menu [HUX / Create Collection]

I2

Inside the collection let’s add a Capsule 3D element. And change some properties of the collection hosting the Capsule.

  • Node List / Size = 1
  • Drag and drop the Capsule to the property Capsule 1 / Transform
  • Rows = 1

I3

Now it’s time to add some scripts and assets to the Capsule so we can have the features we promise some lines above.

Let’s add the following components into the Capsule element:

  • Sphere Collider, So we can have a “physical context” for this element in the virtual world
  • Compound Button (Script), this script will be the one who handles the interaction of the elements. Important, take a look at the Button State property
  • Bounding Box Target (Script), this script defines which actions are going to be attached the the context elements

I4

And after this, we can have a very functional App with a Sphere and associated actions to drag, Scale and Rotate. In next posts I will describe on how to customize the menu.

Source code sample (link).

Happy Coding!

Saludos @ Burlington

El Bruno

References

El Bruno, my posts

Advertisement

4 comments

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: