Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iphone-将摄像机显示为背景,顶部为OpenGLES模型_Iphone_Objective C_Xcode_Augmented Reality - Fatal编程技术网

iphone-将摄像机显示为背景,顶部为OpenGLES模型

iphone-将摄像机显示为背景,顶部为OpenGLES模型,iphone,objective-c,xcode,augmented-reality,Iphone,Objective C,Xcode,Augmented Reality,嗨,我很难将Iphone的4摄像机设置为背景,也很难在上面画出简单的立方体。实现这一目标的最佳方式是什么?我的项目结构很简单,我在委托中使用了opengl类,它完美地绘制了立方体,而控制器并没有做太多工作 因此,相机控制器是下面的代码,需要在opengl视图类中设置,但它不起作用 UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; i

嗨,我很难将Iphone的4摄像机设置为背景,也很难在上面画出简单的立方体。实现这一目标的最佳方式是什么?我的项目结构很简单,我在委托中使用了opengl类,它完美地绘制了立方体,而控制器并没有做太多工作

因此,相机控制器是下面的代码,需要在opengl视图类中设置,但它不起作用

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];
有什么建议吗


谢谢检查此项(这正是您需要的)。

您可以从
不是100%你想要的,但在这种情况下可能会有所帮助