如何动态移动VrPanoramaView中的图像

dev*_*v90 5 android panoramas android-layout android-view

我正在使用以下图像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);
Run Code Online (Sandbox Code Playgroud)

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

我在用GoogleVrSDK

implementation 'com.google.vr:sdk-base:1.160.0'
implementation 'com.google.vr:sdk-panowidget:1.170.0'
Run Code Online (Sandbox Code Playgroud)

Ján*_*iár 4

我认为,你应该切换到Video360

有更多迹象表明该组件已不再开发。

  1. 设置VrPanoramaView的初始角度

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

  1. Android 版 VR 视图

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