Log in or register to post comments

iOS Landscape Orientation

March 20, 2015 - 1:32am #1

Hello,

I have a problem with iphone landscapemode. I am new at Vuforia. I want to orientate ImageTargetViewController only Landscape mode (while opening).

Do anyone help me pls?

 

ImageTargetsViewController can not call these functions:

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation

{

    return UIInterfaceOrientationLandscapeRight;

}

 

-(BOOL)shouldAutorotate

{

    return NO;

}

 

And also I set the function like that but Vuforia Watermark could not seen (it can seen at portrait mode also)

[vapp initAR:QCAR::GL_20 ARViewBoundsSize:viewFrame.size orientation:UIInterfaceOrientationLandscapeRight];

 

Thanks for your effort

iOS Landscape Orientation

July 27, 2015 - 7:30am #7

Could anyone help me pls?

I want to Camera screen only Landscape mode (not for all project)

I use Books Sample

iOS Landscape Orientation

March 31, 2015 - 7:09am #6

First of all, thank you for your dearly support.

I achieved to orientate ImageTarget in LandscapeMode but I want to use only LandscapeRight mode on CameraView (previously viewcontrollers could be Portrait so then i can not block Portrait mode on Target Menu). Even though I wrote 

- (BOOL)shouldAutorotate {

    return NO;

}

- (NSUInteger)supportedInterfaceOrientations {

    return (UIInterfaceOrientationMaskLandscapeRight);

}

 

codes in ImageTargetsViewController, it can be still orientated.How can I resolve the problem?

iOS Landscape Orientation

March 31, 2015 - 2:13am #5

You may also want to check the configureVideoBackground method in SampleApplicationSession; this function is responsible for reconfiguring the Vuforia video background on orientation changes; you can compare the implementation of Books sample with the one used in Image Targets sample; also, make sure that the configureVideoBackground method is actually called when the orientation changes;  the Books sample code also shows how/when to call that method (see BooksViewController source file)

 

iOS Landscape Orientation

March 31, 2015 - 2:08am #4

Hello , I Tried Books example and it works Landscape mode.

But, I want to try ImageTarget in Landscape. When I implemented Imagetarget example (which is from Vuforia SDK) on Books example,  it looks fine on Portrait mode but not good at in Lanscape mode (which was attached on this reply).

In Vuforia Sample the code likes

[vapp initAR:QCAR::GL_20 ARViewBoundsSize:viewFrame.size orientation:UIInterfaceOrientationPortrait];

But in Books sample

[vapp initAR:QCAR::GL_20 orientation:self.interfaceOrientation];

Because in Vuforia Main Sample' SampleApplicationSession.mm

// Initialize the Vuforia SDK

- (void) initAR:(int) QCARInitFlags ARViewBoundsSize:(CGSize) ARViewBoundsSize orientation:(UIInterfaceOrientation) ARViewOrientation {

    self.cameraIsActive = NO;

    self.cameraIsStarted = NO;

    mQCARInitFlags = QCARInitFlags;

    self.isRetinaDisplay = [self isRetinaDisplay];

    self.mARViewOrientation = ARViewOrientation;

 

    // If this device has a retina display, we expect the view bounds to

    // have been scaled up by a factor of 2; this allows it to calculate the size and position of

    // the viewport correctly when rendering the video background

    // The ARViewBoundsSize is the dimension of the AR view as seen in portrait, even if the orientation is landscape

    self.mARViewBoundsSize = ARViewBoundsSize;

    

    // Initialising QCAR is a potentially lengthy operation, so perform it on a

    // background thread

    [self performSelectorInBackground:@selector(initQCARInBackground) withObject:nil];

}

In Books Samples ' SampleApplicationSession.mm

- (void) initAR:(int) QCARInitFlags orientation:(UIInterfaceOrientation) ARViewOrientation {

    self.cameraIsActive = NO;

    self.cameraIsStarted = NO;

    mQCARInitFlags = QCARInitFlags;

    self.isRetinaDisplay = [self isRetinaDisplay];

    self.mARViewOrientation = ARViewOrientation;

    

    // Initialising QCAR is a potentially lengthy operation, so perform it on a

    // background thread

    [self performSelectorInBackground:@selector(initQCARInBackground) withObject:nil];

}

 

I hope that I could explain mine problem. Please let me know why this problem occured?

Thanks

iOS Landscape Orientation

March 30, 2015 - 4:06am #3

In Vuforia Sample application, when I allow to Landscape on Target Menu camera screen can orientate but not truely (ıt can shown half of screen)

Book example includes only cloud example but ı want to use ImageTarget in Landscape mode.

Could you give more helper information?

Thanks for your dearly efforts

iOS Landscape Orientation

March 26, 2015 - 1:52pm #2

The orientation also depends on what you specify in your Xcode project settings (for example, if you allow Portrait only, then your App will never switch to landscape);

the "Books" sample also shows how to support all orientations (landscape and portrait); you can download it from here:

https://developer.vuforia.com/downloads/samples

 

Log in or register to post comments