0
votes

How to adjust each eye view's texture rajawali vr (Cardboard android sdk)?

My 360 photo shows different in two eyes, there are visual differences to left and right eye. As you can see, the image on the left is slightly different from the image on the right. This becomes a very big problem if you see it in Google Cardboard. How to fix it?

enter image description here

The version of rajawali and rajawali vr I used is commit c53cd57 on master branch.

Here is the VR 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;
    }

}

Thanks in advance.

1

1 Answers

0
votes

If you put single camera at origin (x=0,y=0,z=0) in non vr then to enable vr cardboard view you should put two camera for right and left eyes with dimensions (0.3,0,0) and (-0.3,0,0) respectively