如何调整每个眼睛视图的纹理 rajawali vr(Cardboard android sdk)?
我的 360 照片显示两只眼睛不同,左眼和右眼有视觉差异。如您所见,左侧的图像与右侧的图像略有不同。如果您在 Google Cardboard 中看到它,这将成为一个非常大的问题。如何解决?
我使用的rajawali
and版本是commit on master branch。rajawali vr
c53cd57
这是虚拟现实Activity
:
public class CcPhotoViewActivity extends VRActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRenderer(new VRRenderer(this) {
@Override
protected void initScene() {
// R.drawable.loading_bg is a standard 360 photo
Sphere sphere = createPhotoSphereWithTexture(new Texture("photo", R.drawable.loading_bg));
boolean result = getCurrentScene().addChild(sphere);
getCurrentCamera().setPosition(Vector3.ZERO);
getCurrentCamera().setFieldOfView(100);
}
@Override
public void onOffsetsChanged(float xOffset, float yOffset, float xOffsetStep, float yOffsetStep, int xPixelOffset, int yPixelOffset) {
}
@Override
public void onTouchEvent(MotionEvent event) {
}
});
}
private static Sphere createPhotoSphereWithTexture(ATexture texture) {
Material material = new Material();
material.setColor(0);
try {
material.addTexture(texture);
} catch (ATexture.TextureException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
Sphere sphere = new Sphere(50, 32, 16);
sphere.setScaleX(-1);
sphere.setMaterial(material);
return sphere;
}
}
提前致谢。