Today’s goal is bringing together the work we did in the previous days and produce a working demo of the AR/MR capabilities of the ZEDMini. I don’t imagine it will be a daunting task, but I shall proceed carefully. I also want to crop the videos I made last time and also make one or two more in order to have a journal of results I have gotten these past few days.
Right off the bat, I’m facing issues with the VivePro again. It really doesn’t want to track with the base stations and its giving me a lot of trouble. I redid the room setup, elevated my desk and base stations and found out that a slight shake makes connecting sometimes happen. I’m really getting annoyed by these glitches though.
My sample scene with the rotating sphere works but the sphere is too large and sometimes gets sucked into walls. I also noticed that testing it standing up and without my chair in the way, the ZED AR demos are much better. I actually had a fun AR experience with it!
So the ball rotates fine with the RotateSphere script I wrote. Maybe I’ll turn up the speed and adjust position and things like that a little.
Text is very frustrating to place correctly. Unity is glitching a little bit, the equipment is annoying me a lot with it taking a million years to load and there is some window which hides anything i put behind it. I don’t know what kind of window that is.
Some positive results come from using ZED_Rig_Mono (not stereo) and disabling depth occlusion.
For some reason, two TextMeshPro instances cannot be placed in the scene. One really behaves absurdly and isn’t even show in the Game View. We’ll just make due with one instance then.
Now I’ll make a C# script modifying the textPro instance so that it is a timer and counts the sphere’s rotations.
After some time, I finally did code up the scripts and everything is running smoothly! That was my first complete, autonomous experience scripting with C# on Unity. Essentially, I implemented the timer by adding Time.deltaTime each time at the Update() function (even though I also considered System.Timers.Timer as an alternative). I used the Math.Floor() function extensively and also investigated C#’s Property system. Further, I learned about getting components and game objects amongst scripts and objects, which was very helpful in my endeavor to exchange information between different parts of the scene.
Another script counted how many times the ball rotates around the central axis. I store an angle variable which holds the total angle (mod 360) which the ball traverses. Every time the angle passes 360, I increment a counter and modify the TextMeshPro’s text accordingly.
Everything works smoothly with the Camera and I am very satisfied but I am still very frustrated and annoyed by the Vive’s connectivity. It seriously cannot connect. It takes it minutes! I have as clean a setup as I can, I removed the chair and restarted the computer many times. I just can’t get the camera to work with the Vive for my scene! It has made me quite angry this thing. The only error (warning) message I do get is:
If your machine has multiple graphics adapters, Unity may have created a WindowContext on the wrong adapter. If you experience a black screen when playing, please restart the Editor.
I don’t know what this means but it not the case that the specific scene has never worked! It just decided not to work now. I think I’ll call it quits for the day and try again tomorrow. Lots were gained today but this Vive issue has annoyed me plenty.