Log in or register to post comments

Unity 3.5.2f2 and iOS in fixed orientation causes distorted output

May 22, 2012 - 7:47am #1

I'm finding that there is some very strange behavior with Unity 3.5.2f2 and fixed orientations. If I choose a fixed orientation of either Lanscape Left or Landscape Right, the result is a distorted (reversed?) orientation applied to the vuforia view. (See screenshot)

To reproduce:

1) Create a new Unity project
2) Import one of the sample projects (I used vuforia-backgroundtextureaccess-ios-1-5-9.unitypackage)
3) Set the build settings to iOS and choose a fixed orientation of either Landscape Left or Landscape Right
4) Run the project

Notice that the transform of the 3D space is not correct.

Unity 3.5.2f2 and iOS in fixed orientation causes distorted outp

October 29, 2012 - 3:35am #25

Hi soequelle,

Please see this thread:

https://ar.qualcomm.at/content/compatibility-issues-ios6

which discusses the updated SDK for native iOS and also its relevance for Unity where it describes the fix to the orientation issue which is a one line change to AppController.mm.

HTH

N

 

Unity 3.5.2f2 and iOS in fixed orientation causes distorted outp

October 26, 2012 - 8:15am #24

I have the same problem when I choose a fixed orientation of either Lanscape Left or Landscape Right in Unity 3.5.6f24 iOS6 Xcode 4.5.1(4G1004).
How can I fix it?
I tried all solutions in this discussion but without results.

Thank you. 

Unity 3.5.2f2 and iOS in fixed orientation causes distorted

July 2, 2012 - 2:31am #23

When I tested it last week, yes it had :)

iOS in fixed orientation causes distorted output

June 30, 2012 - 10:28pm #22

has this been fixed in the new 3.5.3 update

Unity 3.5.2f2 and iOS in fixed orientation causes distorted

June 27, 2012 - 6:48am #21

Is this also available for iOS. I am targeting iOS first hand. Sorry if this wasn't made clear previously but I thought it didn't need mention. Or will this also work fine for iOS becuase of Unity middleware?

Unity 3.5.2f2 and iOS in fixed orientation causes distorted...

June 27, 2012 - 1:33am #20

Unity 3.5.2f2 and iOS in fixed orientation causes distorted

June 26, 2012 - 10:02am #19

Thats odd. Would you please paste the link to the Video Sample project for my testing?

I'm only targeting landscape and I have been able to get it to work better with the tip from previous post, however I still get the error if the user changes orientation during the video (Unity is paused at that point). Let me have a look at the sample project and see what I'm doing wrong.

Unity 3.5.2f2 and iOS in fixed orientation causes distorted

June 25, 2012 - 7:10am #18

Hi sebrock

I'm not sure what the use case is here as I have been trying to reproduce your problem - but with no success :)

Basically I took the Unity Vuforia Video Sample that has just been released and changing the orientation seems to work fine as intended.  In Unity my orientation is set to Portrait to begin with.

If you set the orientation to be Landscape Right / Left then yes here is an acknowledged Unity problem, and the workaround that I posted previously appears to work.

Let me know how to reproduce the problem with this sample if you can.

 

Unity 3.5.2f2 and iOS in fixed orientation causes distorted

June 24, 2012 - 6:12am #17

I think this is more a Unity-problem in itself, but maybe it is solvable in some way. I does not matter what orientation I choose to use. Unity pauses compleley whenever playing a video on mobile. This has the the effect that if the user turns the device during the video, whenever the video has ended and Unity resumes AND the user has indeed turned the device during playback, QCAR does not seem to pick up the orientation change directly (my overlaying GUI/HUD does). This results in the GUI/HUD being correctly orientated but the camera feed upside-down. Changing orientation once again makes it all display correct.

So is there a way to manually push/update the orientation to the QCAR camera feed at runtime? That would solve the problem.

Unity 3.5.2f2 and iOS in fixed orientation causes distorted...

June 22, 2012 - 1:42am #16

Hi sebrock,

As I understand it this issue only occurs when specifying a fixed orientation in Unity.

You say your camera view always starts in Landscape Right - what did you set it to in Unity?

N

Unity 3.5.2f2 and iOS in fixed orientation causes distorted outp

June 22, 2012 - 1:06am #15

THis seems to work but still, my camera view always starts in LandscapeRight. It can still rotate to LandscapeLeft. I play a movie at the start of my app, the video itself is possible to rotate, but when I get back to the camera view it is always starts in LandscapeRight. Is there any workaround for to get it to start in the correct rotation after the video? This is probably partly due to the fact that Unity pauses when a video is played and doesn't get updated on orientation changes until an active rotation is made again after the video has finished? Anyone got a solution?

Re: Unity 3.5.2f2 and iOS in fixed orientation causes distorted

June 1, 2012 - 3:53am #14

Thanks for this.

We will look into it as we were not previously aware of this issue.

N

Re: Unity 3.5.2f2 and iOS in fixed orientation causes distorted

May 31, 2012 - 2:48pm #13

I noticed another small wrinkle, which others were probably already aware of, but which I was not. If you uncheck the box "Use Animated Autorotation", Vuforia does not get the notification that the orientation changed, so the following line of code doesn't get called in AppController.mm:

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
	QCARUnityPlayer::getInstance().QCARSetOrientation(_curOrientation);

Since shouldAutorotateToInterfaceOrientation returns false, and Unity handles the rotation internally.

Not sure if there is a workaround to this, but thought I'd make people aware. For now, I'm going to live with the animated orientation rotations.

Re: Unity 3.5.2f2 and iOS in fixed orientation causes distorted

May 31, 2012 - 8:17am #12

Hi All,

Ok Unity acknowledged there was a problem here and they have issued an official workaround until the next release :)

N

http://forum.unity3d.com/threads/137295-Fixed-AppController.mm-for-3.5.2

Re: Unity 3.5.2f2 and iOS in fixed orientation causes distorted

May 29, 2012 - 1:23am #11

Excellent

Great this is working out!

Re: Unity 3.5.2f2 and iOS in fixed orientation causes distorted

May 25, 2012 - 12:08pm #10

That did the trick! Thanks!

Re: Unity 3.5.2f2 and iOS in fixed orientation causes distorted

May 25, 2012 - 8:36am #9

Lovely! Just confirmed this as working on 3.5.2f2.

Thanks for the fix, hopefully Unity will fix this up soon.

Re: Unity 3.5.2f2 and iOS in fixed orientation causes distorted

May 25, 2012 - 8:03am #8

http://forum.unity3d.com/threads/136930-3.5.2f2-Massive-Orientation-Issue-Always-Starts-in-Portrait

http://forum.unity3d.com/threads/136088-How-to-Fix-the-3.5.2-Rotation-Problem

It seems that this is due to new code to do with the splash screens that has been implemented in AppController.mm which causes a side effect such that the didRotateFromInterfaceOrientation never gets called and as a result QCAR never sets up the orientation correctly.

One thing to note is that this does not appear to happen on iPads, just iPhone only.

Until this can be fixed at the Unity end, one approach you might like to try is to modify AppController.mm by commenting out the following lines in the shouldAutorotateToInterfaceOrientation method

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// code before

/*
if(_splashView)
{
[INDENT]if(_splashShowing)
{
[INDENT]bool requestPortrait = (targetOrient == portrait || targetOrient == portraitUpsideDown);
if(requestPortrait != _splashPortrait)
return false;

}
_splashShowing = true;[/INDENT]
}
[/INDENT]*/

// code below
}

This seems to eliminate the problem on iPhone and leaves the iPad version unchanged (i.e. still working as before), so it should give you the expected behavior.

N

Re: Unity 3.5.2f2 and iOS in fixed orientation causes distorted

May 24, 2012 - 7:53pm #7

We are investigating this issue.

Re: Unity 3.5.2f2 and iOS in fixed orientation causes distorted

May 24, 2012 - 4:05pm #6

Having the same issue - very alarming! Reverting to previous version of Unity fixed for me also.

Either a bug in latest Unity or a change in the orientation API that Vuforia hooks into I guess. Submitted a bug to Unity anyways.

Re: Unity 3.5.2f2 and iOS in fixed orientation causes distorted

May 23, 2012 - 1:18am #5

I "resolved" this by going back to Unity 3.5.1f2.

The main issue is that when you start in landscape Unity is reporting portrait dimensions. I think it's a Unity issue rather than a Vuforia one.

Re: Unity 3.5.2f2 and iOS in fixed orientation causes distorted

May 22, 2012 - 3:01pm #4

iPhone 4S and 1.5.9.

Re: Unity 3.5.2f2 and iOS in fixed orientation causes distorted

May 22, 2012 - 8:45am #3

Which device(s) are you testing this on? - and which version of the iOS Unity extension are you using?

Re: Unity 3.5.2f2 and iOS in fixed orientation causes distorted

May 22, 2012 - 8:17am #2

Further fiddling has uncovered that the only way to really force a single orientation is to use Autorotate with that single orientation selected, and also select "Use Animated Autorotation". However, it does mean that the orientation that the experience starts in will be whatever orientation the phone is in, and there will be one auto-rotate to the correct orientation, once the user rotates the phone. This is obviously not ideal.

Has anyone else experienced similar issues?

Log in or register to post comments