我在 VrPanoramaView
中使用了下图
当我在 View 中加载它时,它看起来像这样。
但我希望它在打开图像之前将图像动态移动到左侧,就像这样。
我可以用手指移动图像,但我希望它在加载时设置角度。
这是我的代码。
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);
,但没有任何影响。我需要知道如何使用任何手势在全景 View 中翻译图像。
我正在使用 GoogleVrSDK
implementation 'com.google.vr:sdk-base:1.160.0'
implementation 'com.google.vr:sdk-panowidget:1.170.0'
最佳答案
我想,你应该切换到 Video360 :
有更多迹象表明该组件已不再开发。
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.
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 - 如何在 VrPanoramaView 中动态移动图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56253941/