Bonjour,

Je suis ce tutoriel d'openGL ES sur android et je parviens a afficher un triangle correctement, mais lors de l'utilisation de la caméra pour la projection, il ne fonctionne pas.

J'ai pourtant copié exactement le code présenté sur le site.

J'ai constaté que cela ne fonctionne pas lors de l'utilisation d'une variable sur le shader :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
 
 
    private final String vertexShaderCode =
            // This matrix member variable provides a hook to manipulate
            // the coordinates of the objects that use this vertex shader
            "uniform mat4 uMVPMatrix;" +
                    "attribute vec4 vPosition;" +
                    "void main() {" +
                    // the matrix must be included as a modifier of gl_Position
                    // Note that the uMVPMatrix factor *must be first* in order
                    // for the matrix multiplication product to be correct.
                    "  gl_Position = uMVPMatrix * vPosition;" + ////////////////////////C'EST ICI QUE CA NE MARCHE PAS
                    "}";
En effet, si j'enlève la multiplication de la position par la matrice uMVPMatrix, le triangle s'affiche de nouveau.

Avez vous une idée d'où cela peut venir ?

Merci si vous pouvez m'aider.