Log in or register to post comments

Orientation change issue - camera upside down

June 18, 2018 - 7:08am #1

Hi,

i have discovered issue with camera orientation. As shown in video, camera is sometimes upside down after screen orientation change (pretty much all the time when rotation from portrait counter clockwise to landscape) and sometimes starts upside down. Vuforia watermark is always in right place so this issue is should be only in camera

 

I am using latest Vuforia 7.1.35, Unity 2018.1.0f2 and iPhone X with iOS 11.4

Orientation change issue - camera upside down

May 20, 2019 - 1:54pm #9

Hello @gougn46,

I attempted to replicate the issue with the information you've provided and the Vuforia Engine Core samples as downloaded from the Asset Store. Unfortunately, I found no issue with the autorotation script enabled in the Model Target scene: 3-ModelTargets->ARCamera->Scene Orientation

You can see from this video: https://www.dropbox.com/s/25pf7q1ev0j0eef/IMG_0138.TRIM.m4v?dl=0

Thanks,

Vuforia Engine Support

 

Orientation change issue - camera upside down

May 15, 2019 - 7:55am #8

Hi

Still encounter this issue with unity 2019.1.2f1 and vuforia 8.1.11 on iPhone 7.

 

 

Orientation change issue - camera upside down

July 24, 2018 - 7:42am #7

After some googling others' approach to flip the camera for the sake of their app's features, not a bug, I've come to this conclusion:

/// <summary>
/// Negate the Y-axis mapped values in camera's projection matrix to fix the orientation bug.
/// </summary>
public void flipCamProjMtrx(){
  /*    This works, but Vuforia overrrides the change in the next frame because:
   * 'AR Camera matches the device camera's FoV'- AlessandroB.
   * Ergo, Vuforia is miscalculating the device's camera's orientation after it changes with autorotate enabled.
   * One could run this method in Update() to work around the AR Cam orientation bug,
   * but that seems like it'd be crazy resource-intensive.*/
  Matrix4x4 m = Camera.main.projectionMatrix;
  Camera.main.projectionMatrix = m * Matrix4x4.Scale(new Vector3 (1f, -1f, 1f));
}

EDIT: tried running it every frame, and 1: it's not smooth at all, 2: epilepsy trigger

Orientation change issue - camera upside down

July 24, 2018 - 1:25am #6

Hello, the issue still persists.

Versions: Vuforia 7.1.35, Unity 2018.2.0f2 plus 64bit, iOS 11.4.1, on iPhone X

 

Orientation change issue - camera upside down

July 23, 2018 - 11:53am #5

Versions: Vuforia 7.2.20, Unity 2018.2.0f2 personal 64bit, iOS 11.3.1, on iPhone 6s

Issue still persists.

Orientation change issue - camera upside down

July 23, 2018 - 9:04am #4

Hello,

This was a known Unity issue that was present in their 2018.1 beta releases. We filed an internal ticket with Unity to fix.

Our understanding is that this was been resolved by Unity in their 2018.1 commercial release, which at the time we verified.

Thanks,

Vuforia Support

Orientation change issue - camera upside down

July 20, 2018 - 12:44pm #3

For reference, this is my code without locking a sole orientation and it has the same problem (standard portrait orientation, but Vuforia camera is portrait upside down with Vuforia logo rightside up):

public void changeScene(string sceneName){
   switch (sceneName) { 
   case "ARScene": 
       //Screen.orientation = ScreenOrientation.Portrait; 
       Screen.autorotateToPortrait = true; 
       Screen.autorotateToLandscapeLeft = true; 
       Screen.autorotateToPortraitUpsideDown = false; 
       Screen.autorotateToLandscapeRight = true;
       break;
   case "SpecsScreen" : 
       //Screen.orientation = ScreenOrientation.LandscapeLeft; 
       Screen.autorotateToLandscapeLeft = true;
       Screen.autorotateToLandscapeRight = true;
       Screen.autorotateToPortrait = false; 
       Screen.autorotateToPortraitUpsideDown = false; 
       break; 
   default: break;
   }
   Screen.orientation = ScreenOrientation.AutoRotation;
   SceneManager.LoadSceneAsync (sceneName);
}

Note that if you switch the commented code with the code in the case blocks, the issue goes away, but then there is no auto-rotate anymore.

 

EDIT: Confirmed this issue still exists in latest Vuforia 7.2.20. I am testing with an iPhone 6s.

Orientation change issue - camera upside down

July 20, 2018 - 9:49am #2

I am having this issue when I switch scenes in which I change Screen.orientation. Unity version 2018.1.4, Vuforia 7.1.34

EDIT: a workaround:

IEnumerator waitThenRotate(){
  Screen.orientation = ScreenOrientation.Portrait;
  yield return new WaitForSecondsRealtime(1f);
  Screen.autorotateToPortrait = true;
  Screen.autorotateToLandscapeLeft = true;
  Screen.autorotateToPortraitUpsideDown = true;
  Screen.autorotateToLandscapeRight = true;
  Screen.orientation = ScreenOrientation.AutoRotation;
}

Vuforia's ARCamera doesn't like Unity's ScreenOrientation.AutoRotation, it seems. The issue goes away if I first lock an orientation. I can just re-enable autorotate after a second so I don't lose the ability to autorotate. Yay for coroutines!

 

Edit 2: Doesn't actually work. It fixes the AR Camera's orientation but also locks it in portrait. I believe the coroutine is discarded when the scene changes. 

I could have sworn this worked before I went to lunch...

Log in or register to post comments