在 openGl 中绘制基于图像的纹理 android(Wear)

Draw an Image based texture in openGl android(Wear)

我正在 android 中使用 opengl 绘制基于图像的纹理,但图像仅部分绘制如下所示

我的编码

 @Override
    public void onGlContextCreated() {
        super.onGlContextCreated();
        shaders = new ShadersDla();
        float[] vts = { // x, y, s, t.
                -1, 1, 1, 1, -1, 1, 0, 0, 1, -1, 1, 1, 1, 1, 1, 0

        };
        // AllocateDirect prevents the GC moving this memory.
        vtBuffer = ByteBuffer.allocateDirect(vts.length * 4)
                .order(ByteOrder.nativeOrder())
                .asFloatBuffer();
        vtBuffer.put(vts);
    }  
 @Override
    public void onGlSurfaceCreated(int width, int height) {
        super.onGlSurfaceCreated(width, height);
        float aspectRatio = (float) width / height;
 float dist = .001f;
        Matrix.frustumM(projectionMatrix, 0,
                -aspectRatio * dist, aspectRatio * dist, // Left, right.
                -dist, dist, // Bottom, top.
                dist, 100); // Near, far.
   makeTexture();
    }

着色器

private static final String VERTEX_SHADER =
        // Pass in the modelview matrix as a constant.
        "uniform mat4 u_mvpMatrix;  \n"
                // Pass in the position and texture coordinates per vertex.
                + "attribute vec4 a_position;  \n"
                + "attribute vec2 a_texCoord;  \n"
                // Varyings are sent on to the fragment shader.
                + "varying vec2 v_texCoord;  \n"
+ "void main() {  \n"
                // Transform the vertex coordinate into clip coordinates.
                + "  gl_Position = u_mvpMatrix * a_position;  \n"
                // Pass through the texture coordinate.
                + "  v_texCoord = a_texCoord;  \n"
                + "}  \n";

需要一些帮助来做到这一点 stuff.kindly 指导我一个简单的方法,我是 android 和 opengl 的新手....

将纹理坐标更改为

 {-1.0f, 1.0f, 0,0 ,
 1.0f, 1.0f, 1,0, 
-1.0f,-1.0f, 0,1 ,
1.0f, -1.0f, 1,1