Log in or register to post comments

Camera ratio on retina devices

September 2, 2014 - 8:06am #1
Until version 2.8.7, everything was fine.
Now, in 3.0.9, we have troubles with viewport ratio when device is rotated during AR session.
This problem only occurs with retina devices.
This problem only occurs when rotation change during session (if we start and stay in portait or landscape, ratio is good).
 
The visible problem is:
landscape -> portrait: the camera background and our openGL layout are horizontally stretched
portrait -> landscape: the camera background and our openGL layout are vertically stretched
 
Something changed between 2.8 and 3.0 in the sdk, and we would be very pleased if you could help us to understand what.
Thanks

Camera ratio on retina devices

September 10, 2014 - 6:00pm #8

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.

Camera ratio on retina devices

September 10, 2014 - 7:13am #7

I corrected the problem by considerably rewritting our gl view code.

But it seems related to 

- (void)layoutSubviews

{

    mDoLayoutSubviews = YES;

}

 

in class EAGLView

Camera ratio on retina devices

September 9, 2014 - 8:10am #6

Alessandro,

It seems that there is many dead code in the book sample:

in BooksViewController::handleARViewRotation, 80% of the code seems useless

would it be possible to have a cleaned sample ?

 

Camera ratio on retina devices

September 6, 2014 - 10:17am #5

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

September 5, 2014 - 8:30am #4

Thanks for the clue Allessandro, I am digging in the sample :)

Camera ratio on retina devices

September 5, 2014 - 6:30am #3

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.

 

Camera ratio on retina devices

September 4, 2014 - 1:05am #2

Hi,

I am still searching on my side, it's really related to viewport rotation on retina.

Do you have clues on that problem ?

 
Log in or register to post comments