Unity3D: How does Spectator View work through user side of Hololens? - unity3d

I am having a hard time understanding the documentation. So I trying to spectate using a Hololens mounted on a camera. The user Hololens has an application. What do I need to do on the user side Hololens to enable Spectator View? Does it require MRTK? What components do I need to add to make on the Unity3D application (user side) to make it visible by the Spectator Hololens

What do I need to do on the user side Hololens to enable Spectator View? Does it require MRTK?
First, you need to go through the Getting Started to obtain and reference the MixedReality-SpectatorView codebase in your project.
Then, add the MixedReality.SpectatorView/SpectatorView/Prefabs/SpectatorView.prefab to the primary scene and choose a Spatial Alignment Strategy, following Basic Unity Setup for step-by-step tutorial.
For Video camera rig HoloLens, you need to calibrate and test your device according to this document: Spectator View Video Camera Setup.
After that, the PC listens to pose updates from video camera rig hololens and gets scene information from the user HoloLens, then composites this application content into the video camera stream.
Besides, MRTK as an SDK is intended to accelerate the development of MR projects and is not required to enable SpectatorView.

Related

Unity Quest 2 can't grab objects with XR Grab Interactable

I'm new to developing in Unity and VR, and I just managed to load a scene with my custom model into the Quest 2. Now I want to grab an object with the XR Grab Interactable, but when I try to grab the object nothing will just happen. I did not adjust any settings.
I'm also not sure if I connect with the headset the right way because of this. I made a VR project in Unity and connect to my laptop via AirLink. When I press play the scene loads into the headset, so I hope that is just right.

How to Access the stream of HoloLens 2 camera when trying to recognize the marker in AR app?

I am beginner in unity and not so much used to HoloLens 2. Actually I am trying to make a simple AR app for HoloLens 2, when I connect the external camera it is working fine but when I want to access the stream of HoloLens 2 in recognizing the marker, it does not recognize the marker and I do not know that either the HoloLens 2 camera stream is working or not. I used the main camera as the child of MixedRealityPlaySpace and add some components from AR camera but it does not work then I tried AR camera separate and as a child of MixedRealityPlaySpace but still the HoloLens camera stream is not working. It will be great help if anyone knows about the problems. Thanks In advance
Which way are you using for marker recognizing development? Vuforia or Unity AR foundation? Without any specific context the above information does not make any sense to me.
For AR Foundation, 2D Image tracking feature is not supported on HoloLens platforms for now, you can refer to this link to learn more about feature support per platform:Platform Support.
For Vuforia, there is a closed issue that show how to make Vuforia work with the MRTK: What's the current status of using Vuforia with the MR Toolkit? #1461

Accessing Main Camera Left and Right in Unity / google-vr

This is a follow up to this question regarding how to display objects on one camera only in google-vr and unity.
In the current demo project of Unity and Google-vr, I can only access Main Camera Left and Main Camera Right while running the game. During runtime, I am able to disable a layer with the culling mask of one camera.
But I am not able to save those changes while running the game. If I stop, the two Main Cameras Left/Right disappear and I only see Main Camera and GvrReticle as child.
I suspect the cameras are created or imported from a prefab during runtime.
What would be the right way to have the left / right cameras accessible when not running the screne?
It's mentioned in the guide:
Often you will wish to add the stereo rig to your scene in the Editor rather than at runtime. This allows you to tweak the default parameters of the various scripts provided in this plugin, and provides a framework on which to add additional scripts and objects, such as 3D user interface elements.
To turn your Camera into a stereo camera, select the Camera (or Cameras) in the Hierarchy panel, then execute the main menu command Component > Google VR > Update Stereo Cameras.

Vuforia not showing what the webcam sees in Unity while still capturing the marker

I am making a first-person game using Unity and Vuforia. What I'm trying to achieve is that the user can have a marker attached on an object that can be held in his hand (a bottle, a book, or toy). So when he plays the game, he can hold the object in his hand, have the object facing the webcam, and move or rotate the object to control the first person character in Unity, e.g., tilt the marker-attached bottle in physical world so the first person character moves forward in Unity's virtual world. ps. by virtual world I mean just a basic first-person character walking around in a room, not the kind of VR that involves Oculus Rift.
I just played around with Vuforia. The good thing is I can choose my own image as the marker (looks like not every marker-based Unity plug-in can do this). But with Vuforia, can I create a virtual environment that's not showing the webcam's view? I did a basic Vuforia + Unity tutorial that only shows what the webcam captures and overlays a virtual cube on the detected marker. Summary of what I need is: not showing the webcam's view but still have the webcam functioning that it can capture the marker and I can use its position/rotation. In a way you can say I am just using the marker+webcam combo as a sensor used to control my virtual world activity.
Thanks!
From what I get it appears you want to use your marker as a target object to control motion in AR..
You'll have to build the functionality in Unity only as to what you want it to do specifically according to your set gameplay..
For example if you want a virtual dog to follow a target object, one easy way to do it is to provide an offset between the marker and the game Object and play a walking/running animation.
So it will appear as if the object is always following the marker, whereas in reality it is playing same animation at a constant distance.
As far as importing the marker is concerned.. It is no different than what you must have done with your cube..
In your Vuforia account Dev Portal:
Download the Vuforia SDK and import in your Unity asset folder.
Go to Liscense Manager under Develop tab and add a Liscense Key.
Now go to the Target Manager and add your images in the Databse which you want as target. (make sure the image quality is good for it to work prperly)
Now download the database and import it in your Assets folder in Unity.
Now go to your Liscense Manager again and copy your Liscense key and Open Vuforia Configuration under Vuforia Behaviour (Script) when you click on AR Camera, you'll find a dialog box there, paste this key there.
Save the build and run your game in Unity and bring the marker in front of the Webcam and it should work properly.
Hope this helps.

Pause/Freeze a scene with a trackable active in vuforia unity 3d

I am developing an app with vuforia Cloud Recos. I want to add the feature of allowing the user to pause the page so she does not have to keep pointing the device on the target to view the trackable. This is pretty useful when I want to show texts. Is there anyway to achieve that on Unity3D ? A good example is Microsoft's Here City Lens app which includes a button to pause the page as the screenshot shows;
You could take a screenshot of the screen and apply it to an Image UI object. That is if you do not need the camera feed anymore.
If you need interaction with the elements, I would only take a screenshot of the camera feed without items. Get AR camera transform, apply it to a new camera, disable AR camera.Then apply the screenshot to a background plane covering the whole screen. Keep items on as well and they do not listen to Vuforia anymore. You are pretty much recreating a basic Unity scene. The items should not be moving with Vuforia, the camera is. So they are still in the middle and you need to know where was the camera when you took the shot. Your scene is complete