Log in or register to post comments

Cardboard setup

September 3, 2015 - 8:15am #1
 
But it seems to be outdated for the following reasons and making life more difficult than it needs to be becasue of it:
 
1. I cant find AndroidVRDevice.cs script -
Only ones I see are BaseAndroidDevice, BaseCardboardDevice, BaseVRDevice, CardboardAndroidDevice, CardboardiOSDevice, UnityEditorDevice. So which of these is it? Only place I see if UNITY5 is UnityEditorDevice? If I take that out, i get an error with remoteCommunicating = EditorApplication.isRemoteConnected; saying
 
Assets/Cardboard/Scripts/VRDevices/UnityEditorDevice.cs(61,31): error CS0103: The name `EditorApplication' does not exist in the current context
 
2. Cant find debugDisableNativeDistortion = true; either
 
3. I put in Vuforia.VuforiaBehaviour.Instance.ApplyCorrectedProjectionMatrix(proj, eye == Cardboard.Eye.Left); under // Set up the eye's projection. but then get the error below
 
View port sizes of left and right camera are not identical. This is currently not supported by Vuforia!
UnityEngine.Debug:LogError(Object)
Vuforia.StereoCameraConfiguration:CheckForSurfaceChanges()
Vuforia.StereoCameraConfiguration:ApplyCorrectedProjectionMatrix(Matrix4x4, Boolean)
Vuforia.VuforiaAbstractBehaviour:ApplyCorrectedProjectionMatrix(Matrix4x4, Boolean)
CardboardEye:Setup() (at Assets/Cardboard/Scripts/CardboardEye.cs:146)
CardboardEye:Render() (at Assets/Cardboard/Scripts/CardboardEye.cs:216)
StereoController:OnPreCull() (at Assets/Cardboard/Scripts/StereoController.cs:330)
 
 
Feel this really needs to be updated properly, as it clearly hasnt in a while.

Cardboard setup

September 4, 2015 - 3:33am #4

If you are developing on iOS, with 0.5.1 you may experience a crash after launching the Settings Dialog (i.e. the little Cog wheel button which is displayed between the two eye viewports).  However, 0.5.0 does not suffer that issue, so that's the recommended one.

If you are targeting Android only, you can also use 0.5.1, with these changes:

Instead of this:

  • Edit the AndroidVRDevice.cs script (located under Assets/Cardboard/Scripts/VRDevices) and comment out (or remove) the #if UNITY_5 and the #endif surrounding thedebugDisableNativeDistortion = true line

 

use this instruction:

  • Edit the BaseCardboardDevice.cs (located under Assets/Cardboard/Scripts/VRDevices) and change the debugDisableNativeDistortion to true:
protected bool debugDisableNativeDistortion = true//false;

 

Also, the line Vuforia.VuforiaBehaviour.Instance.ApplyCorrectedProjectionMatrix(proj, eye == Cardboard.Eye.Left)

in 0.5.1 needs to be added around line 156 (and not 145, which refers to 0.5.0)

 

// Set up the eye's projection.
    float near = monoCamera.nearClipPlane;
    float far = monoCamera.farClipPlane;
    FixProjection(ref proj, near, far, ipdScale);
    camera.projectionMatrix = proj;

    if (Application.isEditor) {
      // So you can see the approximate frustum in the Scene view when the camera is selected.
      camera.fieldOfView = 2 * Mathf.Atan(1 / proj[1, 1]) * Mathf.Rad2Deg;
    }

    // ADD VUFORIA CODE HERE:
    Vuforia.VuforiaBehaviour.Instance.ApplyCorrectedProjectionMatrix(proj, eye == Cardboard.Eye.Left);

        ...

 

The other Android-specific instructions, such as the AndroidManifest.xml changes, are the same on 0.5.0 and 0.5.1.

 

Cardboard setup

September 4, 2015 - 2:26am #3

ok so to clarify:

0.5.1 doesnt work propery at present and I shoould downgrade to 0.5.0?

or 0.5.1 work fine and thus doesnt require the changes in the setup guide?

 

Thanks

Cardboard setup

September 4, 2015 - 2:01am #2

You are using Cardboard 0.5.1,

but as indicated in the guide, the recommended version for Vuforia 5.0.5 (at present) is Cardboard 0.5.0, and the instructions refer to 0.5.0.

https://github.com/googlesamples/cardboard-unity/tree/v0.5/Cardboard

 

Log in or register to post comments