【问题标题】:How to move image in VrPanoramaView dynamically如何动态移动 VrPanoramaView 中的图像
【发布时间】:2019-05-22 09:46:17
【问题描述】:

我在VrPanoramaView中使用以下图片

当我在视图中加载它时,它看起来像这样。

但我希望它在打开图像之前将图像动态移动到左侧,就像这样。

我可以用手指移动图像,但我希望它在加载时设置它的角度。

这是我的代码。

VrPanoramaView.Options options = new VrPanoramaView.Options();
InputStream inputStream = null;
AssetManager assetManager = getAssets();

inputStream = assetManager.open("test_2"+ ".jpg");
options.inputType = VrPanoramaView.Options.TYPE_MONO;

mVrPanoramaView.loadImageFromBitmap(BitmapFactory.decodeStream(inputStream), options);

mVrPanoramaView.setStereoModeButtonEnabled(false);
mVrPanoramaView.setInfoButtonEnabled(false);
mVrPanoramaView.setPureTouchTracking(true);
mVrPanoramaView.setFullscreenButtonEnabled(true);

我试过mVrPanoramaView.setPivotX(100);,但没有任何影响。我需要知道如何使用任何手势翻译全景视图中的图像。

我正在使用GoogleVrSDK

implementation 'com.google.vr:sdk-base:1.160.0'
implementation 'com.google.vr:sdk-panowidget:1.170.0'

【问题讨论】:

    标签: android android-layout android-view panoramas


    【解决方案1】:

    我想,你应该切换到Video360

    还有更多迹象表明该组件不再处于开发阶段。

    1. Set initial angle of VrPanoramaView

    没有计划向 VrView 小部件添加更多功能。 但是您对 360 媒体播放器的控制更复杂,请考虑使用 Video360 示例作为起点。有关详细信息,请参阅 #510。

    1. VR View for Android

    警告:这些组件已在 GVR SDK v1.190 中移除 安卓。 Video360 示例应用作创建的基础 360 度照片和视频查看器。如果您仍想使用这些小部件, 您需要使用 SDK v1.180 或更早版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-15
      • 1970-01-01
      • 2016-07-19
      • 2021-06-21
      • 1970-01-01
      • 2015-09-05
      相关资源
      最近更新 更多