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.
Dynamically generate holograms
Has anyone been able to dynamically generate holograms in app? I would like to be able to let the user generate his/her own holograms. I have an idea of how I can do it but I'm not sure how to implement it. I would generate a list of vertices and then somehow put a mesh over top. I am not sure if the unity platform can do that or if I need to use directx (which I don't know much about sadly).
Best Answers
-
OptionsPatrick mod
Yes, I've done this. This is easier in Unity, but can be done in DirectX.
In unity the basic pattern is:
on a game object that has a mesh filter and a mesh renderer,
get the mesh filter component.
the mesh filter should have a shared mesh. Get the shared mesh.
generate your vertices and indices.
apply them to the mesh.(The last link has some examples).
===
This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.(Daddy, what does 'now formatting drive C:' mean?)
6 -
OptionsHoloSheep mod
@andrewot there is a great creative coding series of videos that walk you through creating meshes in unity from scratch.
This video might get you started but, you may also want to watch both the 101 series and the rest of the 201 series to get a more complete picture.
As for dynamically creating Holograms in an app, if you are looking to let your user create Holograms by designing their own 3D models and the goal of your app is to be a 3D creation tool maybe even more low level than HoloStudio where the user starts off and adds vertices to create the model then programmatic creation might be the way to go.. but the more common scenarios that I would expect are the ones like HoloStudio where you give the user base parts or where the user just creates multiple instances of one or more existing Holograms.
For the scenarios where you want to give your user the ability to add existing holograms (or parts) to the scene you might want to look into instantiating Prefabs at runtime in Unity and the Instantiate method with Resources.Load:
GameObject MyNewHologram = (GameObject)Instantiate(Resources.Load("MyHologramPrefab"));
Windows Holographic User Group Redmond
WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
WinHUGR YouTube Channel -- live streamed meetings9
Answers
Yes, I've done this. This is easier in Unity, but can be done in DirectX.
In unity the basic pattern is:
on a game object that has a mesh filter and a mesh renderer,
get the mesh filter component.
the mesh filter should have a shared mesh. Get the shared mesh.
generate your vertices and indices.
apply them to the mesh.
(The last link has some examples).
===
This post provided as-is with no warranties and confers no rights. Using information provided is done at own risk.
(Daddy, what does 'now formatting drive C:' mean?)
@andrewot there is a great creative coding series of videos that walk you through creating meshes in unity from scratch.
This video might get you started but, you may also want to watch both the 101 series and the rest of the 201 series to get a more complete picture.
As for dynamically creating Holograms in an app, if you are looking to let your user create Holograms by designing their own 3D models and the goal of your app is to be a 3D creation tool maybe even more low level than HoloStudio where the user starts off and adds vertices to create the model then programmatic creation might be the way to go.. but the more common scenarios that I would expect are the ones like HoloStudio where you give the user base parts or where the user just creates multiple instances of one or more existing Holograms.
For the scenarios where you want to give your user the ability to add existing holograms (or parts) to the scene you might want to look into instantiating Prefabs at runtime in Unity and the Instantiate method with Resources.Load:
GameObject MyNewHologram = (GameObject)Instantiate(Resources.Load("MyHologramPrefab"));
Windows Holographic User Group Redmond
WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
WinHUGR YouTube Channel -- live streamed meetings
You guys are great! Thank you so much!
Is there a difference between dynamically creating meshes vs dynamically creating holograms?
I am trying to generate a plane by having the user set 4 vertices in the real world (using the height (y axis) of the first vertex for all the rest of them so the plane stays on that y "plane" but then using the x and z coordinates for each of the remaining vertices). I am using the world cursor's position and air tapping in order for the user to set the 4 vertices. I wrote the following code on an empty game object with a material, a mesh filter and a mesh renderer component, but no visible mesh is generated when I have set all 4 vertices. Can anyone please tell me what I'm doing wrong? I know the air taps are being recognized correctly from debugging..
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class EditPlane : MonoBehaviour {
}
Thanks!
Here's a Gem from the past. Probably as old as unity itself:
wiki.unity3d.com/index.php/ProceduralPrimitives
Stephen Hodgson
Microsoft HoloLens Agency Readiness Program
Virtual Solutions Developer at Saab
HoloToolkit-Unity Moderator
Essentially no, they're the same thing. A Hologram is what's rendered in front of you on device.
Stephen Hodgson
Microsoft HoloLens Agency Readiness Program
Virtual Solutions Developer at Saab
HoloToolkit-Unity Moderator
@stephenhodgson thank you!