"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Auto rotation on iphone

Hi, I m newbie to iOS and QualComm so please bare with me. I m developing an app in which when any Frame Marker gets detected, i will show an image to the user. I used overlaid image for the same and it is working fine but when i change from Landscape mode to Portrait, the overlaid image does not rotate. Can someone please show me that what i m doing wrong????? Also, when i try to use "shouldAutorotateToInterfaceOrientation" method in ARViewController file, it rotate image but camera in Portrait mode is not showing properly. The camera show only landscap view and also the half screen of iphone is blank in Portrait mode. So I don't know what to do in this situation. Please help me. I used below code for overlaid image: FrameMarkersAppDelegate: UIView* parentV = [[UIView alloc] initWithFrame:screenBounds]; screenBounds = CGRectMake(0, 0, parentV.frame.size.height, parentV.frame.size.width); view = [[EAGLView alloc] initWithFrame: screenBounds]; [parentV addSubview:view]; UIImage *rightImage = [UIImage imageNamed:@"right.png"]; UIImageView *rightImageView = [[UIImageView alloc] initWithImage:rightImage]; rightImageView.center = parentV.center; view.rightImageView = rightImageView; view.rightImageView.hidden = YES; rightImageView.hidden = YES; [rightImage release]; [parentV addSubview:rightImageView]; [viewController setView:parentV]; [window addSubview: viewController.view]; [window makeKeyAndVisible]; To show the image in EAGLView.mm file, i changed below code: switch (marker->getMarkerId()) { case 0: [self performSelectorOnMainThread:@selector(showRightImageView) withObject:nil waitUntilDone:NO]; break; - (void) showRightImageView { rightImageView.hidden = NO; } Thanks, Hardik

Hi Hardik I think you just need to add a View Controller to the view you want to autorotate, that needs to implement shouldAutoRotate... See the 'overlayViewController.m' in the ImageTargets example - it does exactly that.

hardik_vh

Fri, 10/14/2011 - 06:27

Hi MoSR, Let me first tell you what i am planning to do using FrameMarker QCAR. I want to start QCAR based on let say some button press and also want to stop QCAR.

hardik_vh

Mon, 10/17/2011 - 11:39

It worked now, sorry for posting again and again. I changed x and y coordinate to show it properly on landscape mode. Thanks Hardik

[QUOTE=hardik_vh]It worked now, sorry for posting again and again. I changed x and y coordinate to show it properly on landscape mode. [/QUOTE] :-) Well done for working it out!