how to use the cardboard sdk for pc vr game? - unity3d

so I want to create a vr game using unity3d and cardboard sdk for PC(windows), which I'll stream to my phone screen using kinoConsol. I created a simple scene when I build it for android,it works fine , I mean it shows the dual sbs camera(screen), but a windows build shows only one normal camera(screen).. is there a way I can use the cardboard sdk to show the sbs camera(screen) in a windows build ?? if not is there any thing else available to achieve this ?

Side by side is easy, just place two cameras where the eyes should be and change their viewport rect to half width. Now you have a side by side stereo renderer without any external library. Cardboard also adds some distortion to the lenses, but it is not that important to use it in your case.
Your second, and much bigger problem is the gyroscope - you have to somehow communicate the position of your headset to your unity app on your pc. This is not trivial and probably will require finding or building an persistent service on your android device that will send the orientation data to your desktop app.

Related

Vuforia Ground Plane Detection doesn't work when using webcam (IP webcam using Iriun Webcam in android phone)

Thought of using Vuforia as it allows testing using a webcam. So, i downloaded Iriun Webcam (IP Webcam for android), and succesfully got the video stream inside the Unity Editor when i press "Play".
I created a minimal AR example, where my app would detect a plane and a tap would place an object.
My issue is that when I Build the apk and test it on my phone it works perfectly as it should, but when i do it using the play button inside the editor, the video stream is captured, but it won't do any AR stuff (like plane detection as it was supposed to do)
Please help me with any possible reason there could be, as I couldn't find any such issues faced by anyone else
I created a minimal AR example, where my app would detect a plane and a tap would place an object.
My issue is that when I Build the apk and test it on my phone it works perfectly as it should, but when i do it using the play button inside the editor, the video stream is captured, but it won't do any AR stuff (like plane detection as it was supposed to do)
As mentioned here https://library.vuforia.com/unity-extension/vuforia-play-mode-unity Ground Plane is not supported when using a webcam in Unity Play Mode. Ground plane relies on a robust device tracker and this is not available when using a webcam. However, to help development, it is possible to record a sequence on a device and then using this in play mode https://library.vuforia.com/platform-support/recording-and-playback. The other option is to emulate the Ground Plane behavior using an Image Target as discussed here https://library.vuforia.com/ground-plane/introduction-ground-plane-unity.

How to draw lines from browser on remote mobile AR app?

I am looking for a solution to share the screen from a mobile AR app (ARKit or Unity AR Foundation).
The screen needs to be shared to a browser on the desktop and it should be possible to draw lines on the screen from the browser using the mouse in the AR environment that can be seen on the mobile app which is sharing the screen.
After some investigation there does not seem to be a viable solution to truly share the same AR instance with browser/mobile as you can do with 2 mobile devices.
There should however be some sort of work around possible as it can be done with Vuforia Chalk AR.
Here is a GIF showing how it works:
AR Drawing demo
Sharing a video seems to be possible
Specifically trying to figure out how the line is drawn from the browser and then displayed on the mobile AR app
How can you achieve the same functionality with open source alternatives or Unity and custom code (No Vuforia is possible)?
Looking for a tutorial or some directions to how this can be implemented.

Google VR SDK stuck in portrait mode

I've built the app and compiled it with VR enabled and cardboard selected as my VR device. I can install and run it on my phone (Samsung S8) BUT the in game camera is stuck in portrait mode and the yew is inverted (turning my head left turns the camera right). I have scoured the internet but still can't find a way to fix this.
I've enabled VR in playersettings and added google cardboard as my VR.
I've also disabled portrait views under orientation.
I've set the camera as both a child and parent object.
I've built the app with both cardboard and daydream selected as the VR (and each individually) but still the same issue.
I've tried forcing different higher levels of API requirement
I have added and removed GvrEditorEmulator from the project and the GvrControllerMain and no luck.
I've even flipped the camera manually by a 180 degrees and this made the view be in landscape but in this case the pitch was inverted (when I look up the camera looks down) and I haven't found a way to resolve this.
In the editor view the screen looks fine, but every time I run it on my Android phone it force starts in portrait mode and the pitch or yew is inverted.
Is there a hidden option I need to switch, does anybody have more suggestions that I could try?
You can see what the app looks like when I hold the phone i portrait mode on the link bellow (the image breaks when I try to add it to the post for some reason).
https://imgur.com/a/o80NRe4
Its worth mentioning that I'm working with Unity version 2019 2.0b2 because any other version I tried would not detect my installed Android SDK and would not let me build the project. I've tried on multiple machines and always had that problem so I'm afraid of attempting an upgrade to a newer version would break my build ability.
This seems to be a known and reported issue for Google VR SDK for unity. Its been reported on their github page.
The only possible fix is reverting back to Unity 2018.3.14f1. I did this by exporting my v2019 project, then creating a new 2018.3.14f1 version project and importing the original into it. This rebuilds the project and should avoid conflicts if you're lucky.

Why is not Unity recognizing my digital camera?

I have mixed around with Unity and Vuforia. Im all set and got it to work with an image that spawns 3D objects. My project has been done with my FaceTime Camera on my Macbook pro 2018. Now i want to try and move over to my Digital Camera: Sony AX6300. But when i connect the camera, Unity wont recognize it. I can still only choose FaceTime Cam built in on my Mac. Can anyone in here help out maybe?
Image
You have to edit the xml file named webcamprofiles.xml inside vuforiaresource, and add or edit your device camera name...
it works for me

Detecting when device in cardboard headset in Unity

I'm building a Unity Cardboard app, and would like to detect when the device is in the headset. The NFC in theory has this data, but it does not seem to be exposed in the API. I would like to have the app automatically enter VR mode when in the headset, without the user needing to toggle in and out of a VR mode.
Basically, I want Cardboard.vrModeEnabled to be automatically updated when you enter or exit a headset.
Is this possible? Thanks!
It used to be in the (non-Unity) SDK but was deprecated, for several reasons. For one, the NFC sensors on phones are placed in different places, so the detection was not uniformly reliable. For another, using the sensor this way drains battery quickly.
There are a lot of cardboard models on the market. a lot of them don't come with an NFC tag. so i wouldn't count on it.
Best approach for me is to start in VR mode, when the user touches the screen, disable VR mode for 10 seconds since the last touch and then go back to VR mode.