Esempio n. 1
0
        public PointCloud(int maxDepthPoints)
        {
            mAverageZ = 0;
            int vertexShader = RenderUtils.loadShader(GLES20.GlVertexShader, sVertexShaderCode);
            int fragShader   = RenderUtils.loadShader(GLES20.GlFragmentShader, sFragmentShaderCode);

            mProgram = GLES20.GlCreateProgram();
            GLES20.GlAttachShader(mProgram, vertexShader);
            GLES20.GlAttachShader(mProgram, fragShader);
            GLES20.GlLinkProgram(mProgram);
            Matrix.SetIdentityM(ModelMatrix, 0);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final int buffers[] = new int[1];
            int[] buffers = new int[1];
            GLES20.GlGenBuffers(1, buffers, 0);
            mVertexVBO = buffers[0];
        }
Esempio n. 2
0
        public Trajectory(int lineWidth)
        {
            mLineWidth = lineWidth;
            // Reset the model matrix to the identity
            Matrix.SetIdentityM(ModelMatrix, 0);

            // Allocate a vertex buffer
            ByteBuffer vertexByteBuffer = ByteBuffer.AllocateDirect(MAX_VERTICES * BYTES_PER_FLOAT);

            vertexByteBuffer.Order(ByteOrder.NativeOrder());
            mVertexBuffer = vertexByteBuffer.AsFloatBuffer();

            // Load the vertex and fragment shaders, then link the program
            int vertexShader = RenderUtils.loadShader(GLES20.GlVertexShader, mVertexShaderCode);
            int fragShader   = RenderUtils.loadShader(GLES20.GlFragmentShader, mFragmentShaderCode);

            mProgram = GLES20.GlCreateProgram();
            GLES20.GlAttachShader(mProgram, vertexShader);
            GLES20.GlAttachShader(mProgram, fragShader);
            GLES20.GlLinkProgram(mProgram);
        }