ARToolkit, UIImagePickerController & cameraOverlayView: How to take a picture?
I am developing an Augmented Reality app for iPhone with ARToolkit. Now I want to include its functionality in a main app, with a button which throws an 'AR View', in order to be able to take a picture with the 3D model on it.

I am using **UIImagePickerController** with **cameraOverlayView** to add the ARViewController view to the camera view, as an overlay, but it does not show it. Here it is the code:




    -(IBAction)Switch2AR:(id)sender{
	
	ARController = [[ARViewController alloc] init];
	[ARController loadView];
	
	UIImagePickerController *picker  = [[UIImagePickerController alloc]init];
        picker.delegate = self;
	
	
	if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
	{
		picker.sourceType = UIImagePickerControllerSourceTypeCamera;
	}
	else {
		picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
	}
	picker.showsCameraControls = YES;
	
	picker.cameraOverlayView = ARController.view;
	
	
	//[ARController.view addSubview: picker.view];
	//[picker.view addSubview: ARController.view];

	//[picker viewWillAppear:YES];
	//[picker viewDidAppear:YES];
	//[ARController viewWillAppear:YES];
	//[ARController viewDidAppear:YES];

	
    [self presentModalViewController:picker animated:YES];
	
	[ARController release];

    }


I also tried to add the **UIImagePickerController** view as a subview of the **ARViewController view**, but does not work since the camera modal view 'hides' the AR view. Also ARViewController view as **UIImagePickerController** subview.

The problem is that I cannot overlay my ARView and the camera view in any way I tried

Thanks in advance
ARToolkit, UIImagePickerController & cameraOverlayView: How to take a picture?
===

I am developing an Augmented Reality app for iPhone with ARToolkit. Now I want to include its functionality in a main app, with a button which throws an 'AR View', in order to be able to take a picture with the 3D model on it.

I am using **UIImagePickerController** with **cameraOverlayView** to add the ARViewController view to the camera view, as an overlay, but it does not show it. Here it is the code:




    -(IBAction)Switch2AR:(id)sender{
	
	ARController = [[ARViewController alloc] init];
	[ARController loadView];
	
	UIImagePickerController *picker  = [[UIImagePickerController alloc]init];
        picker.delegate = self;
	
	
	if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
	{
		picker.sourceType = UIImagePickerControllerSourceTypeCamera;
	}
	else {
		picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
	}
	picker.showsCameraControls = YES;
	
	picker.cameraOverlayView = ARController.view;
	
	
	//[ARController.view addSubview: picker.view];
	//[picker.view addSubview: ARController.view];

	//[picker viewWillAppear:YES];
	//[picker viewDidAppear:YES];
	//[ARController viewWillAppear:YES];
	//[ARController viewDidAppear:YES];

	
    [self presentModalViewController:picker animated:YES];
	
	[ARController release];

    }


I also tried to add the **UIImagePickerController** view as a subview of the **ARViewController view**, but does not work since the camera modal view 'hides' the AR view. Also ARViewController view as **UIImagePickerController** subview.

The problem is that I cannot overlay my ARView and the camera view in any way I tried

Thanks in advance