2012-02-15 4 views
0

저는 ar보기를 가로 모드로 설정하는 방법을 알고 싶습니다. ARToolkit, 가로 모드에서보기를 설정하는 방법

NSLog(@"bound %@",NSStringFromCGRect([self.view bounds])); 
    NSLog(@"bound %@",NSStringFromCGRect([[UIScreen mainScreen] bounds])); 

    glView = [[ARView alloc] initWithFrame:[[self view] bounds] pixelFormat:kEAGLColorFormatRGBA8 depthFormat:GL_DEPTH_COMPONENT16_OES stencilFormat:0 preserveBackbuffer:NO]; 
    glView.arViewController = self; 

    self.view = glView; 

    UIToolbar *toolbar = [[UIToolbar alloc] init]; 
    toolbar.frame = CGRectMake(0, 255, 480, 44); 
    toolbar.barStyle = UIBarStyleBlack; 

    NSMutableArray *items = [[NSMutableArray alloc] init]; 
    [items addObject:[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(stopAR:)] autorelease]]; 
    [toolbar setItems:items animated:NO]; 
    [items release];  
    [self.view addSubview:toolbar]; 
    [toolbar release]; 

는이 작업을 수행 할 이유가 궁금이 있지만 효과

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    [super shouldAutorotateToInterfaceOrientation:interfaceOrientation]; 
    return UIInterfaceOrientationIsLandscape(interfaceOrientation); 
} 

답변

0

을 설정했습니다. ARView는 카메라의 비디오를 보여줍니다. 모델은 마커 방향과 관련하여 표시됩니다. 따라서 가로 모드 또는 세로 모드 모드를 처리 할 필요가 없습니다. 오버레이보기가있는 경우 방향 변경을 처리해야합니다.

+0

오버레이보기를 추가하는 방법을 알려주세요. – Desmond

+0

ARView에 하위보기를 추가하여 오버레이보기를 추가하십시오. – Mark