Portals and Planes

Got to grips with the Magic Kit.  Magic Leap was kind enough to set up some very thorough tutorials with a lot of helpers to let you do baby steps on accessing, using, and showing the capabilities of the device, so I cribbed a bunch of stuff related to plane detection, gestures, and interactivity.  

This has mostly been a bit of a wander.  Initially I wanted to port a janky Hololens demo to Magic Leap, but I soon realized that a straight port wasn’t going to happen without some basic understanding of how things work.  I wanted to understand and come up with a design language and paradigm that mimics the way humans actually work.  The ML1 tracks hands, eyes, and 6DOF headpose, and if that’s not enough, there’s a 6DOF hand controller, kind of like the Vive’s, that you can use for more precise work.

I’ve gotten to the point where I can detect planes and light them up when you look at them.  Placing geometry on them is a foregone conclusion and I’ve read and thoroughly understand the example code.   Half of the work is following the bread crumbs of functions through the scripts, but as usual, I’ve jumped off into the weeds with an exercise in rendering the currently looked-at plane as if it was a portal to another dimension.

That means shader code.  Balls to that.  I’m crap at it and it’s the kind of thing that’s been done over and over again.   So this is where I’ll plug the Gater Portal System from MAD;SCIENTISTS.

It does the basic portal thing, where a camera in and looking at another area renders on a texture in the  current one.  There are tons of examples out there, but this one is straightforward and easily hacked or added to your own stuff to get you what you need.

Obviously, generating a shitload of portal prefabs when the MagicLeap detects all the planes it can see is a non-starter, so I’ll have to figure out how to script portals only where the active plane is.  

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.