This is a list of how I got FlightGear to (somehow) work on cardboard VR glasses.
Done on windows 10 and Android 9 phone.
It should work if PC and phone are on the same wifi, but update rate is most likely better with USB connection, USB network sharing on the phone, and phone (and PC) set to airplane mode...
Note that the software I used are ones I found to work, I have no other connection to them. Also, you do everything on your own risk!
Check the PC ip address with ipconfig.
- Install OpenTrack on the PC
- From OpenTrack's
doc\contrib\FlightGear\Protocoldirectory copy theheadtracker.xml' to FlightGear'sdata\Protocol` directory - From OpenTrack's
doc\contrib\freepie-udpcopy theFreePIE_IMU_Android9.apkto the phone and install it - Launch OpenTrack on the PC and set input to "FreePIE" (port 5555) and output to FlightGear (port 5542)
- Launch FreePIE on the phone, set the PC's IP address and port and start the output. Opentrack should show the rotating octopus if everything works.
- Launch FlightGear with
fgfs.exe --generic=socket,in,25,localhost,5542,udp,headtracker(note the port 5542 and the name of the xml file) - Rotate your phone and FlightGear's view should turn. If something is wrong, try to tune the axis in OpenTrack
- Install TightVNC server on the PC
- Launch the VNC server
- Configure VNC server (right click on the tray icon --> Configuration), at least set viewer password, maybe address restrictions
- Install RealVNC's VNC viewer on the phone
- Add the connection by giving it some name and PC's IP address. Try to connect and enter view password. Hopefully it works.
- Hide the menu bar (from the "pin" icon) and switch to landscape mode
- From FlightGear's View meny select Stereoscopic View Options and set the
HORIZONTAL_SPLIT - Adjust eye separation to match your viewer
With everything set up, launch everything and FlightGear and put the phone in the cardboard glasses and enjoy.
I got very bad framerate but it is most likely due to my slooooow laptop, maybe this would work better with a better PC...
The view location in fgfs is often wrong because OpenTrack overwrites the aircraft's view position offsets.
There is no distortion correction shader or anything, but it does not seem to matter too much.
- Maybe use this script/protocol in FGFS? https://forum.flightgear.org/viewtopic.php?f=6&t=37102