Hi I’m having difficulties setting as background the Iphone’s 4 videocamera and drawing simple cubes with openglES on top. What’s the best way to achieve that? My project structure is simple, i have in the delegate the opengl class which draws the cubes perfectly and the controller doesn’t do much.
So aparently the camera controller is the following code which gas to be set in the opengl view class, but it’s not working.
UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init];
imagePicker.delegate = self;
imagePicker.navigationBarHidden = YES;
imagePicker.toolbarHidden = YES;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.showsCameraControls = NO;
imagePicker.cameraOverlayView = self;
// The 54 pixel wide empty spot is filled-in by scaling the image.
// The camera view's height gets stretched from 426 pixels to 480 pixels.
float bandWidth = 54;
float screenHeight = 480;
float zoomFactor = screenHeight / (screenHeight - bandWidth);
CGAffineTransform pickerTransform = CGAffineTransformMakeScale(zoomFactor, zoomFactor);
imagePicker.cameraViewTransform = pickerTransform;
m_viewController = [[UIViewController alloc] init];
m_viewController.view = self;
[m_viewController presentModalViewController:imagePicker animated:NO];
Any tips?
Thanks
Check this example (this is exactly what you need).