Пример #1
0
        //private CardboardOverlayView overlayView;

        public void onDrawEye(Eye eye)
        {
            GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);

            checkGLError("colorParam");

            // Apply the eye transformation to the camera.
            Matrix.multiplyMM(view, 0, eye.getEyeView(), 0, camera, 0);

            // Set the position of the light
            Matrix.multiplyMV(lightPosInEyeSpace, 0, view, 0, LIGHT_POS_IN_WORLD_SPACE, 0);

            // Build the ModelView and ModelViewProjection matrices
            // for calculating cube position and light.
            float[] perspective = eye.getPerspective(Z_NEAR, Z_FAR);
            Matrix.multiplyMM(modelView, 0, view, 0, modelCube, 0);
            Matrix.multiplyMM(modelViewProjection, 0, perspective, 0, modelView, 0);
            drawCube();

            // Set modelView for the floor, so we draw floor in the correct location
            Matrix.multiplyMM(modelView, 0, view, 0, modelFloor, 0);
            Matrix.multiplyMM(modelViewProjection, 0, perspective, 0,
                              modelView, 0);
            drawFloor();
        }
        // Error	3	'AndroidCardboardExperiment.Activities.ApplicationActivity.onDrawEye(com.google.vrtoolkit.cardboard.Eye)': no suitable method found to override	X:\jsc.svn\examples\java\android\synergy\AndroidCardboardExperiment\AndroidCardboardExperiment\ApplicationActivity.cs	328	31	AndroidCardboardExperiment
        // StereoRenderer
        public void onDrawEye(Eye eye)
        {
            GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);

            checkGLError("colorParam");

            // Apply the eye transformation to the camera.
            Matrix.multiplyMM(view, 0, eye.getEyeView(), 0, camera, 0);

            // Set the position of the light
            Matrix.multiplyMV(lightPosInEyeSpace, 0, view, 0, LIGHT_POS_IN_WORLD_SPACE, 0);

            // Build the ModelView and ModelViewProjection matrices
            // for calculating cube position and light.
            float[] perspective = eye.getPerspective(Z_NEAR, Z_FAR);
            Matrix.multiplyMM(modelView, 0, view, 0, modelCube, 0);
            Matrix.multiplyMM(modelViewProjection, 0, perspective, 0, modelView, 0);
            drawCube();

            // Set modelView for the floor, so we draw floor in the correct location
            Matrix.multiplyMM(modelView, 0, view, 0, modelFloor, 0);
            Matrix.multiplyMM(modelViewProjection, 0, perspective, 0,
              modelView, 0);
            drawFloor();
        }