Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Official Proxy Grid - square/hex grids of items on planes

Discussion in 'Unity MARS' started by leweyg_unity, Jun 9, 2020.

  1. leweyg_unity

    leweyg_unity

    Unity Technologies

    Joined:
    Jan 29, 2020
    Posts:
    38
    Here is a useful utility if you'd like to create your MARS worlds out of square or hex grids (originally for a "Game of Go" played over your AR world). It includes some utilities+configurations+events for not only laying out the grid but also keeping track of edges (connections) between the vertices (points) on the grid as they grow and change. An example scene and readme is included.

    ProxyGridExample.png

    We have some amazing plans for really polishing up this feature later on, hope this tides you over until then, and feel free to customize to your liking!
    -Lewey G.
     

    Attached Files:

  2. wickedwaring

    wickedwaring

    Joined:
    Feb 5, 2014
    Posts:
    32
    Hi Lewey G,

    Thanks for this, looks great, have had a run on device (iPhone XR), being relatively new to room scanning like this, could you advise:

    a) Is there anyway of increasing the speed in which it scans / generates the grid?
    EDIT: Turned off debug executable in the build scheme helped some.

    b) How would I change the granularity of the grid (more vertices, smaller squares etc), I have tried making the values in GridConfig.cs smaller but it does not seem to change anything.

    Would this also allow the grid to sit on smaller surfaces?

    Thank you
     
  3. leweyg_unity

    leweyg_unity

    Unity Technologies

    Joined:
    Jan 29, 2020
    Posts:
    38
    IUsesMarsSceneEvaluation
    Hey @wickedwaring , some quick answers:

    a) To increase the speed of scanning, by default there is a 2.0s wait between MARS "solves", you can change this in "Assets/MARS/Settings/Resources/EvaluationSchedulerModule.asset" and set "Evaluation Interval" so something like 0.2 or 0.3s. This can also be done via API by adding the "IUsesMarsSceneEvaluation" interface and calling "
    this.SetEvaluationInterval(0.3f);"

    b) To adjust the grid side, the script is just the default, find your "ProxyGrid" object, expand "Config" and adjust the "Distance Between Same Plane" (most important) and also lower the "Radius of Vertex".

    Hope that helps!
    -Lewey G.
     
    wickedwaring likes this.
  4. unity_zfKQjXzJKzk1ow

    unity_zfKQjXzJKzk1ow

    Joined:
    Jun 6, 2022
    Posts:
    7
    Hi,

    That plane should be in the square made in the grid? Or which is his role?

    Thank you!
     
  5. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
    Hey there,

    Quite the opposite, the grid gets placed in the planes that you scan from your device
     
  6. unity_zfKQjXzJKzk1ow

    unity_zfKQjXzJKzk1ow

    Joined:
    Jun 6, 2022
    Posts:
    7
    Ok. And if I want to put something in the square created in the grid what you recommend me to do?

    Thanks!
     
  7. unity_zfKQjXzJKzk1ow

    unity_zfKQjXzJKzk1ow

    Joined:
    Jun 6, 2022
    Posts:
    7
    Or, how can I put a flower field on the ground and any other horizontal plane?
     
  8. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
  9. unity_zfKQjXzJKzk1ow

    unity_zfKQjXzJKzk1ow

    Joined:
    Jun 6, 2022
    Posts:
    7
    I read almost all of the documentation and I don't know or cannot think to a method in which I can occupie an entire surface with an object. Because, my problem is that when I put an horizontal proxy and an object in it it will always appear only once per surface and if my phone starts to recognize two portions of an surface it creates 2 separate object, but when i recognize the space between it make a whole surface and creates only one object from the two created before.


    Thank you for your response!
     
  10. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
    Last edited: Jun 8, 2022