Developing a Simulator with Unity which needs to run on PC and Android VR glasses at the same time - unity3d

I'm developing a Simulator with Unity, The Sim is running on a PC and connect to the Sim and everything is working great.
The issues are that the Sim rotates 360 so i can't look and the pc screen that is in the operator station and also i want the player to be able to look around.
For that i need for the VR glasses to be connected the to what is running on the PC and run the at the same time and see the same scene, all controls are from the PC to the physical sim and back, the VR is just for that (looking around)
The only solution i could find or is to run a node.js server (for simplicity running node.js, can be any server) and getting the data from there.
I wonder if there is a better way to do that.
Sorry about not show any solution, i'm not there yet, clueless about where to start with the connection, the Simulator is running perfectly on the PC, just don't know how to connect to the VR glasses so both will see the same thing.
10x

Just implement multiplayer and connect the VR as a client to the PC.
It's easy to setup and run. Your client can have VR capabilities, that the sim doesn't need.
Unity's networking (UNET) is deprecated, so I would use Mirror. But any other networking system would also work.

Related

Using Virtualbox within Unity

We want to demo one of our Android system, in a virtual world using Unity. We would want to use for example a Virtualbox to simulate our virtual system, and show its display on Unity.
We would also want that Android device to be able to connect to an outside internet service exactly like a real physical Android device would do.
Is this doable, and if yes, how can this be done using Unity and Virtualbox?

Control Camera desktop application using Gyroscope of Android smartphone

For a project at my university I need to create a Unity3D application on my laptop, in which the camera is stationairy and can be controlled to rotate in any direction using the gyroscope of my Android smartphone (Nexus 5), wirelessly or through usbcable.
I've looked at the possibility of OSC or the Unity Remote 5 App, but up till now haven't found a way that works in order to obtain this result.
Any help or advice would be hugely appreciated - I don't have much experience yet with all this.
Thanks!
If i was going to do this then I would use UNET (Unitys built in multiplayer networking API) and have the rotation sync over LAN.
On the camera I would have a Network Transform and a script to control its rotation based on accelerometer input.
The version on the phone would be the authority and sync it's rotation over the network to the client on the laptop.
Pros: Wireless, fast (over wifi), very little code required to make it work, lots of documentation available online.
Cons: Relies totally on your network situation, you will have to do a lot of trial and error to get a smooth experience (not jerky) i think.
As for getting the tilt input on the device, Unity have a great tutorial here: https://unity3d.com/learn/tutorials/topics/mobile-touch/accelerometer-input
It's pretty straight forward.
Sound like a fun project, good luck!
It's possible to do this via cable, WiFi, Bluetooth 2.0 or Bluetooth 4.0 (BLE). I have implemented what you need in WiFi and Bluetooth 2.0 for my current work.
It's pretty easy to get rotation values and stream them from Android but I don't think you will need to do anything because you can just use this!
https://play.google.com/store/apps/details?id=de.lorenz_fenster.sensorstreamgps&hl=en
So the question is how do you receive the data this is sending on Unity's side. The answer is the UdpClient class.
If you need more reliability because every second student in your uni library is torrenting Mr. Robot and your getting huge lag then I can tell you how to implement the same thing in Bluetooth, which is not super trivial as .NET 2.0 (which unity uses) doesn't support bluetooth libraries, but there are solutions...

How to debug(play) Unity 5 for Gear VR without having it transferred to the phone?

I made things in Unity 5 for Gear VR.
When I connect Galaxy S6 and on Unity, do
File -> Build and Run
The phone tells me to connect the phone with Gear VR, and after doing that everything works fine.
But when i press Play from Unity, Unity itself crashes and closes itself.
So i have to download and debug on the phone everytime i want to debug, which takes so much time.
So there any easy way of debugging unity for gear vr on mac?
you might not be able to debug using Unity (like Unity profiler, etc), but you can use Android studio or adb to debug it, so everytime you do Debug.Log and its family, they will be printed into the log just filter it with Unity keyword.
Since using cable is unfeasible for GearVR, you need to use adb with TCP/IP i.e. using wireless. There are a lot of articles on how to use adb wifi, for example here
Hope this helps

Google Cardboard controlling PC

When I saw the Google Cardboard for Unity, I assumed this meant that you would be able to make a Unity PC game and use your phone as a screen/controller. All I can see is it wanting me to make an android app which is all well and good, but it doesn't allow for input from the keyboard.
Is there a way to stream the Unity PC project to the device and retrieve input (i.e. Headtracking, NFC magnet)?
The problem with such a solution is latency. In VR latency is a big deal. The overall latency from input to photons reaching your eyes should be 20ms or lower. Regular games have 30-60 ms latency by themselves. Add to that the gyro latency, the phone display latency... If you want to add another 25ms or more ping to your VR experience, that's gonna be painful and may even make you sick. If you want to read more on why latency is such a big deal in VR, Michael Abrash wrote an excellend blogpost about it: post on latency
If you want to necessairly use a keyboard for navigation, consider using a bluetooth keyboard that can be used with android devices. Also keep in mind that with the current technology, especially without a dedicated headset, really dynamic vr experiences probably won't work very well and can make some people uncomfortable or sick. For a good read on designign virtual reality experiences, please refer to this guide from the Oculus Rift: http://static.oculus.com/sdk-downloads/documents/Oculus_Best_Practices_Guide.pdf
There's nothing in the Cardboard SDK for talking with a PC-hosted Unity game. You could adapt the code from the Unity Remote 4 project:
https://www.assetstore.unity3d.com/en/#!/content/18106
We are developing the app what you want except it uses GearVR instead of Cardboard. Please check the link below.
http://challengepost.com/software/airvr
Streaming from your PC to your phone's Cardboard is possible using third-party apps, such as Trinus VR (the client app on your phone) and Vireio (the streaming app on your computer). The two apps will then communicate via your home network (Wi-Fi or other) to stream the images.

WIA can not find my internal camera in windows 7

I am currently working on a project where I need to access a build in camera (software will run on a tablet), stream what the camera is showing, and allow the user to take a picture from the stream. I have a version of what I am trying to accomplish on my laptop with its built in camera working. The major difference is the Laptop is using windows XP the tablet is using windows 7.
Running the software on the tablet I get an exception (with some research it appears that exception is cause by no WIA device found). Is it possible that the built in Camera is not WIA compatible? The device does show in the Device Manager as an USB Camera Device, but unlike the camera on my laptop I can't access it directly. I have to use 3rd party software put in by the tablet maker to get the camera to work.
Has anyone experience similar problems? I have to believe if the tablet maker can do what I need I should be able to do something similar.
There also is the Windows Portable Device API that can access cameras, but that appears to be written in c++, without a .NET wrapper. Does anyone know of a simple tutorial of how I could get .NET to place nice with it? EDIT: Just tried WPD didn't list any devices either. I am beginning to thing this camera doesn't exist.
Any knowledge/ pointers to resources would be appreciated. (So far google has turned up the same few articles, no matter which way I approach the problem)
Turns out my Camera was not WIA compatible. I was able to get the tablet to do what I needed it to do using directshow (actually directshow.net)
Good links if others are trying to do something similar and having similar problems
http://msdn.microsoft.com/en-us/library/dd375454%28VS.85%29.aspx
http://directshownet.sourceforge.net/faq.html