Log in or register to post comments

How to rotate video feed when changing device orientation on iPad2

January 5, 2012 - 4:37pm #1

Hi,

I have developed an AR application for iPad2 that uses an ImageMarker to display a 3D object on screen, in front of the camera feed, when the marker is detected. My app needs to run in landscape mode to handle display of the 3D model well (aspect ratio of the 3D model object).

The app has GUI elements (buttons and labels), and these are also displayed in front of the video feed.

I have submitted the app to the app store, but it was rejected because the app only supports device orientation LandscapeLeft at the moment, and apple requires it to support at least two device orientations (LandscapeLeft & LandscapeRight is sufficient).

I have managed to rotate the GUI elements from LandscapeLeft to LandscapeRight when the iPad is rotated. I do this by looking for changes to the Input.deviceOrientation value, and when it changes, I set the iPhoneSettings.screenOrientation to either iPhoneScreenOrientation.LandscapeLeft or iPhoneScreenOrientation.LandscapeRight.

However, when I do this, the video feed is not also rotated. This has the effect that when I rotate the device from landscape left to landscape right, the GUI elements are rotated correctly, but the video feed is displayed upside down (it is not rotated).

Does anyone know if I can rotate the video feed to solve my problem? I am running the Unity 1.0 iOS extension and Unity 3.4.2.

Re: How to rotate video feed when changing device orientation on

January 6, 2012 - 2:14pm #2

The QCAR 1.0 Unity Extension does not support auto-rotation. You might be able to solve your problem by rotating the GUI instead of rotating the entire view in response to orientation changes. See the GUIUtility.RotateAroundPivot method:

http://unity3d.com/support/documentation/ScriptReference/GUIUtility.RotateAroundPivot.html

- Kim

Log in or register to post comments