【问题标题】:How to transparent Google VR SDK's cardboard view scene's background to show camera preview?如何透明 Google VR SDK 纸板视图场景背景以显示相机预览?
【发布时间】:2017-02-28 14:12:02
【问题描述】:

和TreasureHunt 的例子一样,有黑底蓝底和六色立方体。我期望的是让场景黑色背景消失(透明或清晰的颜色),并显示我复制的相机预览。类似于 AR 效果。

但是,在主视图控制器 loadView() 中,当我为 _cardboardView 设置背景清除颜色时,它不起作用。 VR 场景背景为黑色。

self.view = _cardboardView;
_cardboardView.backgroundColor = [UIColor clearColor];
_cardboardView.layer.backgroundColor = (__bridge CGColorRef _Nullable)([UIColor clearColor]);
self.view.backgroundColor = [UIColor clearColor];  

或者当我在这里设置任何区分颜色时,VR场景背景仍然是黑色的。

【问题讨论】:

    标签: google-cardboard google-vr google-vr-sdk


    【解决方案1】:

    除了 backgroundColor 之外,为 carboardView.layer 的所有子层设置 opaque NO。它在 vrModeEnabled 为 NO 时起作用。我不知道什么时候 vrModeEnabled 是 YES。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-16
      • 2014-12-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多