【问题标题】:Vuforia VideoPlayback LandscapeVuforia VideoPlayback 横向
【发布时间】: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


    【解决方案1】:

    我遇到了同样的问题,我将 VideoPlaybackViewController.mm 中的代码行更改为

    [vapp initAR:QCAR::GL_20 ARViewBoundsSize:viewFrame.size orientation:UIInterfaceOrientationLandscapeLeft];
    

    因为我的应用只在横向模式下工作,所以这对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-05-20
      • 1970-01-01
      • 2012-07-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多