Results 1 to 3 of 3

Thread: OpenGL ES Android - Texture repeating on each face

  1. #1
    Junior Member
    Join Date
    Apr 2012
    Posts
    2

    OpenGL ES Android - Texture repeating on each face

    Hello, I am working with the Qualcomm AR SDK and I have used a Perl script to transform a banana model (.obj) to my own layout of arrays. All works correctly apart from the model texturing repeats on every face instead of stretching over the entire model. Blender shows the model correctly before I scale it while rendering in the application.

    Does anybody have any idea of what to do or what to check to fix this? I have been struggling for a few days now!

    Others have done this same thing with the same model and script without problems.



    Code :
    // Constants:
    static const float kObjectScale = 90.0f;
     
    const Texture* const thisTexture = textures[0];
     
            glUseProgram(shaderProgramID);
     
            glVertexAttribPointer(vertexHandle, 3, GL_FLOAT, GL_FALSE, 0,
                                  (const GLvoid*) &vertArray[0]);
            glVertexAttribPointer(normalHandle, 3, GL_FLOAT, GL_FALSE, 0,
                                  (const GLvoid*) &normalsArray[0]);
            glVertexAttribPointer(textureCoordHandle, 2, GL_FLOAT, GL_FALSE, 0,
                                  (const GLvoid*) &coordsArray[0]);
     
     
            glEnableVertexAttribArray(vertexHandle);
            glEnableVertexAttribArray(normalHandle);
            glEnableVertexAttribArray(textureCoordHandle);
     
     
            glActiveTexture(GL_TEXTURE0);
            glBindTexture(GL_TEXTURE_2D, thisTexture->mTextureID);
            glUniformMatrix4fv(mvpMatrixHandle, 1, GL_FALSE,
                               (GLfloat*)&modelViewProjection.data[0] );
            glDrawArrays(GL_TRIANGLES, 0, VERTEX);

    I think that is all the code which will help,

    Any information is welcomed!

  2. #2

    Re: OpenGL ES Android - Texture repeating on each face

    Have you tried by including filtering modes to GL_LINEAR/ GL_NEAREST.?

  3. #3
    Junior Member
    Join Date
    Apr 2012
    Posts
    2

    Re: OpenGL ES Android - Texture repeating on each face

    Sorry I have since fixed this problem, it was in fact related to the array precision after some manipulations on the array. Thank you for your suggestion none the less! Much appreciated

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •