Note that there are some explanatory texts on larger screens.

plurals
  1. POUnifeyeMobileViewController glView camera view is not rotating in iPhone
    primarykey
    data
    text
    <p>in my iPhone application, I am using metaio sdk with UnfieyeMobileViewController. I have customized the view to show the camera view on the EAGLView component, and its works fine. The issue the when rotate the device, the camera orientation is not changing. And also, the captured image is showing upside down. Here is my code, please check:</p> <p>In ViewDidAppear:</p> <pre><code>UIInterfaceOrientation interfaceOrientation = self.interfaceOrientation; [self willAnimateRotationToInterfaceOrientation:interfaceOrientation duration:0]; [super viewDidAppear:animated]; - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration { // adjust the rotation based on the interface orientation switch (interfaceOrientation) { case UIInterfaceOrientationPortrait: self.glView.transform = CGAffineTransformMakeRotation(0); break; case UIInterfaceOrientationPortraitUpsideDown: self.glView.transform = CGAffineTransformMakeRotation(M_PI); break; case UIInterfaceOrientationLandscapeLeft: self.glView.transform = CGAffineTransformMakeRotation(M_PI_2); break; case UIInterfaceOrientationLandscapeRight: self.glView.transform = CGAffineTransformMakeRotation(-M_PI_2); break; } // make sure the screen bounds are set correctly CGRect mainBounds = [UIScreen mainScreen].bounds; if( UIInterfaceOrientationIsLandscape(interfaceOrientation) ) { int width = mainBounds.size.width; int height = mainBounds.size.height; mainBounds.size.width = height; mainBounds.size.height = width; } if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) { // for iPhone the aspect ratio does not fit, so let's correct it if( UIInterfaceOrientationIsLandscape(interfaceOrientation) ) { mainBounds.size.height = 360; // because our renderer is a bit larger mainBounds.origin.y = -20; } else { mainBounds.size.width = 360; // because our renderer is a bit larger mainBounds.origin.x = -20; } } self.glView.frame = mainBounds; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload