简体   繁体   中英

How to adjust each eye view's texture rajawali vr (Cardboard android sdk)? My 360 photo is different in two eyes

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?

在此处输入图片说明

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.

如果您在非VR中将单个摄像机放置在原点(x = 0,y = 0,z = 0)上,则要启用VR纸板视图,您应该为左右眼放置两个摄像机,尺寸分别为(0.3,0,0)和( -0.3,0,0)分别

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM