Cardboard.SDK.VRModeEnabled fullscreen touch control - touch

I am able to have my app run in VR mode and all works well, I can view 360 degrees, gaze at menu options etc, all good.
I can also switch to fullscreen mode and for the most part, all good in that I can view 360 degrees, but I have to physically rotate the device as if in VR mode, there is no touch control to enable a user to swipe in all directions to view the 360 world.
Is there a way to achieve this? Should I be disabling Cardboard an implementing a new camera?

Related

How to change the AR Foundation Camera Rotation and position using joystick in Unity3d

I am creating a project like AR Portal in the AR foundation.
there are two modes in this:
AR Mode
Joystick Mode
Everything is going well with AR Camera and in AR mode.
In joystick mode, I am unable to rotate the camera and I am stuck on that problem and didn't find any solution.
If I disabled the Tracked pose Driver of AR Camera, then it will work but if I enable the Tracked Pose Driver, then it will not work.
Is it possible to rotate the camera when Tracked Pose Driver is enabled?
I'm not sure what you're trying to do there. AR camera is usually a physical camera, changing its position and rotation by code would not make a lot of sense. If you are using the joystick for a different scene/ part of the scene, try using a regular Unity camera and write a simple controller to move it around.

Why does the scene camera change position and rotation on play

Win 10 Pro, Unity 2019.2.17f1
This issue occurs on occasion, randomly. It has happened with multiple different scenes on this machine.
In this instance, I have a scene that is completely empty except for the default Main Camera and Directional Light. I have not added any scripts to the scene. In the inspector the camera is at position 0, 10, 0 with rotation 90, 0, 0 by default. Once I hit play, the camera instantly jumps to a seemingly random position and rotation. If I delete the main camera and make a new camera game object, the same thing happens to it. Please see this screen recording demonstrating the problem:
https://youtu.be/JMl2arXzeCo
I'm thinking it might have something to do with the fact that I have SteamVR running on my machine. Does anyone know what causes this, and where I might be able to find a setting to toggle this behavior? Thank you
In the console you get
OpenVR Initilaized
You seem to have Virtual Reality Support enabled in the ProjectSettings -> Player -> XR Settings thus the camera position and orientation is controlled by a virtual reality device.
From the orientation I would guess that it lies around somewhere ^^
Simply disabling this should fix your issues.
To add to derHugo's answer: to stop the camera from following the VR device without disabling VR support, set the Camera component's Target Eye property to None (Main Display).

Unity - Google Cardboard camera view without rotating view (iOS)

I'm looking to use Google Cardboard in Unity 3D, but I don't want the camera to rotate when the user rotates their head. How would this be done?

Google Cardboard VR HUD UI Issue

I'm currently creating a google cardboard vr app and I'm running into an issue for the UI. The VR app is set up to be on rails by creating an animation for an empty object that contains the google cardboard camera prefab. I have a world space canvas that has 3 UI objects (backwards, pause, and forward similar to the iphone). In the first case the UI works for pausing (time scale set to 0) as seen in the image below.
However the issue I'm having is having those UI icons show up while in motion. The icons seem to go off in a weird direction have a mind of their own - even though I can track the canvas and know it's in the same position relative to the camera. If I pause in game or in the editor it returns to the correct state in example 1.
I have the canvas set to world space and the event camera is the google cardboard camera prefab. I'm not sure what's going on.

Device roll compensation on augmented reality

I'm working on an app that performs geolocalization over the camera stream of the iPhone. I use the compass to figure out where to put the icons and information onto the the camera layer. If I rotate the device around yaw axis everything works fine.
However, when I roll the iPhone all the information on screen goes away. That's because when you roll the device the compass orientation also changes. However, there are apps like Layar or Wikitude that allow roll rotation without losing focus on the visual items you have onto the camera layer. That way, these apps allow smooth transition between portrait orientation to landscape orientation.
How they achieve that? How can I compensate the roll rotation of the device to keep information on screen?
By the way, the ARKit framework has the same problem as me.
Thanks.
If you are in 2D maybe it is enough to take the point you are calculating from camera field view and offset heading, calculate the distance to the center of the screen, and use that distance as a radius for a circle to do x += r*cos, y += r*sin with -roll as the angle, so the object moves in a circle against the roll. Then you just have to counter rotate the image itself with a transform (CGAffineTransformMakeRotation) to keep it vertical.