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.
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]
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
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
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).
Saludos @ Burlington
El Bruno, my posts
- Device Portal Basic Features for Developer
- How to Import the HoloToolkit Unity
- How to place a Hologram using AirTap and HoloToolkit
- Creating a menu with options with HoloToolkit
- Using voice commands to display a menu with HoloToolkit
- How to create a 3D text always visible using HoloToolkit
- How to create a HUD (3D text always visible without HoloToolkit)
- How to detect hands using HoloToolkit
- Windows 10, Xbox One Controller, Bluetooth and some lessons learned
- How to use Fire Buttons actions with an XBoxOne Controller
- HoloToolkit compiled packages for Unity3D in GitHub
- How to detect AirTap and Click actions using HoloToolkit
- Detect user hand interactions using #HoloToolkit
- Moving and rotating Holograms using an XBoxOne Controller
- Spatial Understanding vs Spatial Mapping, and a tutorial on how to use them
- Spatial Mapping, tutorial to search for simple surfaces, like a 1×1 tile on the floor
- Alternative to fix the Tap to Place and World Anchor issue, until the official release of HoloToolkit for Visual Studio 2017 and Unity3D 5.6
- How to save a #3D model of the environment around the device
- How to improve the App deployment time from Visual Studio 2017 to Hololens using an USB cable
- How to use the Developer Portal when the device is connected via USB
- Lunar Module, new Sample App from Mixed Reality Design Labs with some very cool tools and prefabs for Unity3D development
- Tutorial to use buttons dialogs and more with MRDesign Labs