Magic Leap: Meshing n things

Alright nerds here's one way to get your digital thingys in the real world.

Meshing. Of the magic kind.

Based on this thing called ‘spatial computing’ It’s a super complicated process that involves world reconstruction detecting real world surfaces and makes them digitized in a 1000 line script.

So here’s what you do.


Drag and drop.

No seriously all you do is drag and drop, cause if you open up that little ML Spatial Mapper Script you’re gonna get this:

Make it stop

Which is all well and good but if you’re partially an impatient dweeb you’ll do what I did… Look at it later at half past never.


*Note: If for whatever reason your project just isn’t recognizing a RaycastHit _hit and you’ve written dozens of Debug.Log’s and your ML1 isn’t recognizing shite, drop that bad boy up there in your project.

In order for this to work though, you need the “WorldReconstruction” privilege under the Player Settings. So when you try the MLSpatialMapper you’ll see a bunch of little triangles which is the basic geometry of how ML1 gets environmental information, which looks like this:

World reconstruction based on Geometry

In the Meshing tutorial on Magic Leap’s creator portal they set the shader to a WireFrame, (VR/SpatialMapping/Wireframe). So what I like to do is to set that to transparent like so:

Is it the right way to do things? Probably not, but it works and it doesn’t break things. You can always make your own shader if you know how too.

Awesome, now on to RAYCASTING.