Unit testing UI interaction with MRTK3
Dotnet by Example
by Joost van Schaik
1M ago
Unit testing is a method software developers use to ensure code reliability. It involves writing extra code to input known data into other code - the business logic - expecting a known output. For example, testing an Add function with “Add(1,2)” and expecting the result to be 3. If the test passes, the function is ‘covered’ by tests. Ideally, testing all components and their assemblies should ensure the whole program works. However, users interact mostly with the user interface, not the business logic. If the UI is flawed, even with correct business logic, it’s like having a car with all compo ..read more
Visit website
Detecting user presence using MRTK3 gaze tracking state
Dotnet by Example
by Joost van Schaik
2M ago
Sometimes it’s necessary to know whether or not the user is actually wearing the headset while running your app. For instance, this might be because the user is doing an important task that may not be stopped until completed, or because you want to pause critical, performance-heavy, or battery-draining processes on the device when the user takes it off for a few minutes. I have found MRTK3 gaze tracking state to be a reliable way to detect user presence, and wrote a little ServiceFramework Service to utilize that. Profile (Almost) everything in the ServiceFramework starts with a profile, and ..read more
Visit website
Using the non native keyboard in touch scenarios in MRTK3
Dotnet by Example
by Joost van Schaik
2M ago
History repeats itself - a little under four years ago, I wrote about how the non-native keyboard in MRTK2 could be made to play with the then-new HoloLens 2 - a device that introduced touch instead of air tap to control holograms and UI elements. I devised a simple behaviour that fixed that in early 2020 to make it touch-enabled, and that even made it into the MRTK2. Times have moved on, we are now on MRTK3 and in a multi-platform era. For fun, I have started to rebuild on of my apps - Walk the World - in MRTK3, because this always leads to interesting spelunking into the depths of SDKs. In t ..read more
Visit website
Getting the hand ray end position with MRTK3
Dotnet by Example
by Joost van Schaik
5M ago
Like I wrote before, I sometimes feel like I am Microsoft’s one-man Mixed Reality Q&A department, judging by the number of questions I get. I guess it’s becoming common knowledge that I have the tendency to actually answer a lot of those questions ;). Anyway, after showing how to get the position of the hand while doing an air tap, I thought I was done on this subject. Nope: two different developers wanted to know if I could tell them how to get where the hand ray was projecting on. Well, I don’t know if I have found the right way, or even the best way, but I at least have found a way. I m ..read more
Visit website
An MRTK3 KeywordRecognitionSubsystem for Magic Leap 2
Dotnet by Example
by Joost van Schaik
6M ago
As I have shown already, MRTK3 is very versatile and very well suited for cross-platform development. The architecture is extensible by the usage of Unity subsystems. At Magic Leap, they have used that to implement a version of the Hands subsystem - that allows hand tracking to work - and you can use that by simply selecting a different implementation of the subsystem in the Android MRTK3 profile: For contrast, this is the HoloLens 2 profile. Here the OpenXR Hands API is selected instead of the Magic Leap one. Magic Leap 2 also supports keyword recognition - there is a custom API for that in ..read more
Visit website
A cross-platform Service Framework service to write Unity log messages into files on-device
Dotnet by Example
by Joost van Schaik
6M ago
HoloLens applications conveniently dump all the Unity log messages in a text file - including all run time errors. This file can be very useful for tracking down weird occasional errors that only happen at run time. Getting to the file from HoloLens is a bit cumbersome, you have to go via the device portal and you really have to know where to look, it is always called UnityPlayer.log and at least you can get to it. When I started developing for Quest and Magic Leap 2 as well, I noticed no such file was available. When I was experimenting with getting Lumi - Augmedit’s flagship product for bra ..read more
Visit website
Getting raw air taps and their positions with MRTK3
Dotnet by Example
by Joost van Schaik
6M ago
Over the last few months, I sometimes feel like I am Microsoft’s one-man Mixed Reality Q&A department, as I get lots of questions for tips, samples, and guidance. Apparently, many students and scientists are trying to get to grips with Mixed Reality. I try to answer them all, but sometimes it takes a while, as I attempt to answer them in order of appearance - and I also have a day job as an MR developer. Anyway, this week a developer asked me on GitHub how you could not only get a raw air tap in MRTK3, but also how you could get the tap position. So I took a look at the repo from my blog p ..read more
Visit website
Using a Spatial Mesh with MRTK3 on Magic Leap 2
Dotnet by Example
by Joost van Schaik
7M ago
After successfully porting the MRTK3 version of HoloATC to Magic Leap 2, I wanted to try some other experiments on it as well. For one of those experiments, I needed to use the Spatial Map. How hard could that be? I just added an ARMeshManager to the XR MRTK Rig like I do for HoloLens, as per my own blog post, and… nothing happened. After some searching, I found a sample in this repository, but I couldn’t get it to work in my app (I must admit I found it a bit overcomplicated). I contacted some friends at Magic Leap and they advised me to turn to the Magic Leap forums - which I did. In one of ..read more
Visit website
Running a YoloV8 model on a Magic Leap 2 to recognize objects in 3D space
Dotnet by Example
by Joost van Schaik
7M ago
After I successfully got to run YoloV8 models on HoloLens 2 to recognize the model aircraft I made as a teenager and locate them in space - using the Unity Barracuda inference engine to process the model - I thought it would be fun to try this on the Magic Leap 2 as well. The short version of this experiment is - it worked, as this 4x sped up video shows: However, this was … quite a venture. Camera access When I wrote about using the Spatial Map on Magic Leap 2, I was surprised to learn Magic Leap hadn’t implemented ARMeshManager. However, using a simple behaviour filled that void. That was n ..read more
Visit website
Full underlay passthrough transparency with MRTK3 GA on Quest 2/Pro
Dotnet by Example
by Joost van Schaik
7M ago
Hey, didn’t I write about this before? Indeed, I did, but last Monday I got a report from José Rocha that my sample didn’t work anymore after he followed my upgrade tutorial for MRTK3 GA. After trying that myself on the sample, I had to agree he was right: instead of full transparency, I got to see the default Unity Skybox. Ugh. The solution turns out to be extremely simple. After some plodding around in the MRTK3 GA sources, searching for the word “SkyBox” found me the CameraSettingsManager behavior. Where it comes from, I don’t know, but it is certainly the solution. To get transparency back ..read more
Visit website

Follow Dotnet by Example on FeedSpot

Continue with Google
Continue with Apple
OR