Proxy Grid - square/hex grids of items on planes

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.

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.

5959694–638978–ProxyGrid.unitypackage (13 KB)

3 Likes

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

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.

1 Like

Hi,

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

Thank you!

Hey there,

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

Ok. And if I want to put something in the square created in the grid what you recommend me to do?

Thanks!

Or, how can I put a flower field on the ground and any other horizontal plane?

Hey there,

For that I would suggest you to check our docs to get familiarized with the concepts in MARS: Unity MARS concepts | Unity MARS | 1.4.1

And to quickly get you started; you can just create a plane condition on a proxy and add a prefab object as the children of the proxy like this: Working with Unity MARS | Unity MARS | 1.4.1

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!

Ah I see,

If you want to spawn a single proxy in several places what you might need to use then is a replicator; with this it will spawn several instances of the proxy; more info here:
https://docs.unity3d.com/Packages/com.unity.mars@1.4/manual/WorkingWithMARS.html#using-a-replicator-to-place-content-on-multiple-surfaces