Search Unity

Best way to generate content on spatial meshes (Magic Leap & Hololens)

Discussion in 'AR/VR (XR) Discussion' started by Jelmer123, Mar 11, 2019.

  1. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    243
    Hi

    I'm playing around with Hololens and magic leap and would like to know the best approach to generate content on the spatial mesh?
    For example: if you want some grass and rocks appear on the floor?

    I'm considering doing raycasts into the space from the user's point of view, and where it hits the spatial mesh I could instantiate prefabs. But maybe there is a more intelligent and controlled way to do this?

    Like this is my current setup:
    - a particle system attached to the camera that shoots some particles and a scritp that creates gameobject when it hits the magic leap spatial mesh.. I guess it's fine as long as you don't need to many random objects.
     

    Attached Files:

    Last edited: Mar 11, 2019
  2. dmennenoh

    dmennenoh

    Joined:
    Jul 1, 2015
    Posts:
    379
    Just curious, is that room with the furniture in it generated by magic leap? IE is that the spatial mesh? It's just so clean...
     
  3. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    243
    It's the spatial mesh from the magic leap emulator (they call it magic leap remote) :)
     
  4. dmennenoh

    dmennenoh

    Joined:
    Jul 1, 2015
    Posts:
    379
    Oh, OK... so it's not the actual ML's spatial mesh. We actually have one here in the office but it hasn't gotten much interest from any of the devs.