其他分享
首页 > 其他分享> > android-如何在VrPanoramaView中动态移动图像

android-如何在VrPanoramaView中动态移动图像

作者:互联网

我在VrPanoramaView中使用以下图像

enter image description here

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

enter image description here

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

enter image description here

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

这是我的代码.

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'

解决方法:

我认为,您应该切换到Video360

有更多迹象表明此组件已不再开发.

> Set initial angle of VrPanoramaView

There are no plans to add more functionality to the VrView widgets.
But you more complex controls for a 360 media player, consider using
the Video360 sample as a starting point. See #510 for more info.

> VR View for Android

Warning: These components were removed in v1.190 of the GVR SDK for
Android. The Video360 sample should be used as a basis for creating
360 photo and video viewers. If you still want to use these widgets,
you will need to use SDK v1.180 or earlier.

标签:android-layout,android-view,panoramas,android
来源: https://codeday.me/bug/20191108/2005292.html