- Sort Posts
- 7 replies
- Last post
Camera ratio on retina devices
Camera ratio on retina devices
Camera ratio on retina devices
Camera ratio on retina devices
I just want to say that I am having the same problem with similar symptoms:
- If I start out in landscape, and rotate to any portrait mode, I get a stretched image and a black vertical band on the right hand side
- If I start out in portrait, and rotate to any landscape mode, I get a stretched image and a black horizontal band on the top side
If I start out in portrait or landscape, video is displayed properly, without black bands or stretching. It's the rotated views that cause issues (i.e., start in landscape right: fine; rotate to portrait: distorted; rotate to landscape left: fine).
This is all on an iPad Air; I don't have a non-retina device to test on.
I'm not using custom code, but in fact using the sample code from the Books application and SampleApplicationSession.mm (I call changeOrientation). I'm very confused, as I've tried to check everywhere that the sample code that I've incorporated into my project is exactly the same as that in the 3.0.5 Books example. I did begin this project under 2.8.7; is there anything that you would suggest that I check in terms of differences between 2.8.7 and 3.0.5 project settings/methods/properties?
Thanks!
Camera ratio on retina devices
Hi,
not aware of any changes in this regard;
in general, orentation handling in Vuforia iOS requires that you intercept the orientation changed event and that you call this API:
QCAR::onSurfaceChanged(new_width, new_height); QCAR::setRotation(QCAR::ROTATE_IOS_90); // or ROTATE_IOS_180 for landscape left, etc...
There is a complete implementation example available in the Books-3-0-9 sample; you may want to test the sample on a Retina device and see how it behaves.
Then, if you open the sample in XCode and you check the SampleApplicationSession.m, you will be able to find the - (void) changeOrientation:(UIInterfaceOrientation) ARViewOrientation function code, which code you can check and compare to your custom implementation.
In the same source file, you can also find more code about handling the view bounds and orientation.
In particular, one thing you need to make sure to do, is to call configureVideoBackground() function to update the video background to reflect the screen size changes and the new orientation.
Concerning other differences between 3.0 and 2.8, in 3.0 some iOS devices support HD camera resolution, which means that you can get a camera video background image with much higher resolution than in 2.8... perhaps this is what is causing the issue in your application,
for example some of your application code might have worked OK in 2.8 as it was only tested against relatively low resolutions, but breaking in 3.0.9 due to the use of higher resolution.
Thanks for pointing that out; I hadn't noticed that aspects of the Books code. I "solved" the problem by locking the orientation to Landscape Right, which works best for my use case. But this is useful if I need to support different orientations in the future.