【发布时间】:2014-02-27 07:34:24
【问题描述】:
我正在使用 Vuforia 为我的公司创建演示应用程序。我可以根据示例项目扫描目标并播放视频。然而,这仅在纵向。如果我尝试在设备横向模式下扫描目标图像,我的相机也会将对象旋转为纵向。
我检查代码:
VideoPlaybackViewController.mm
[vapp initAR:QCAR::GL_20 ARViewBoundsSize:viewFrame.size orientation:UIInterfaceOrientationPortrait];
尝试将其更改为 UIInterfaceOrientationMaskAll,但不要将相机仅显示在屏幕左侧。
尝试更改一些代码 SampleApplicationSession.m 也是,但没有运气
- (void) prepareAR {
// Tell QCAR we've created a drawing surface
QCAR::onSurfaceCreated();
// Frames from the camera are always landscape, no matter what the
// orientation of the device. Tell QCAR to rotate the video background (and
// the projection matrix it provides to us for rendering our augmentation)
// by the proper angle in order to match the EAGLView orientation
if (self.mARViewOrientation == UIInterfaceOrientationPortrait)
{
QCAR::onSurfaceChanged(self.mARViewBoundsSize.width, self.mARViewBoundsSize.height);
QCAR::setRotation(QCAR::ROTATE_IOS_90);
self.mIsActivityInPortraitMode = YES;
}
....cut
我删除了另一个 if 函数,因为调试总是运行这个函数。 有人有同样的经历吗? 谢谢
【问题讨论】:
标签: ios objective-c augmented-reality vuforia