matrix calculations dont work

I’m came over a problem which I can’t figure out. I want to move the camera position but nothing happens. I looked over some code examples but I still have no idea whats going wrong. Could somebody give me a hint? =/
Thanks. =)

void MainWindow::display()

    //setup model matrix
    glm::mat4 model = glm::mat4(1.0f);
    model *= glm::mat4(1.0f);

    //setup view matrix
    glm::mat4 view = glm::mat4(1.0f);
    view *= glm::lookAt(glm::vec3(0.0f, 0.0f, 10.0f),  //eye
                        glm::vec3(0.0f, 0.0f, 0.0f),   //center
                        glm::vec3(0.0f, 1.0f, 0.0f));  //up-vector

    //setup projection matrix - [fovy, aspect, zNear, zFar]
    glm::mat4 projection = glm::mat4(1.0f);
    projection *= glm::perspective(45.0f, 1.0f, 0.1f, 20.0f);

    //calculate matrix
    glm::mat4 vertrexTransform = projection * view * model;

    //send our matrices to the shader
    glUniformMatrix4fv(glGetUniformLocation(program, uniform_mvp), 1, GL_FALSE, glm::value_ptr(vertrexTransform));

    glClearColor(0.0, 0.0, 0.0, 1.0);
    glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0);
    glDrawArrays(GL_TRIANGLES, 0, 3);


#version 330
in vec3 vertices;
uniform mat4 ModelViewProjectionMatrix;
void main(void)
    gl_Position = ModelViewProjectionMatrix * vec4(vertices, 1.0);

nobody? =/

Are you checking for GL errors?

Have you dumped the value of the matrix you’re populating the uniform with to verify that it looks reasonable?

If you’re stumped, cook a short stand-alone GLUT test program and post it. Usually in the process of doing that, you’ll discover your bug.

There are no error. In my code I am checking if the shader and program are correctly and if I there was some problems with getting my attribute. But everything seems correct.

I started with that tutorial 1 from wikibooks ( ). So I went back to that code and modified it with the glm code. And surprisingly everything works fine. But I really can’t find any difference in my display method.

If you look you can see that the display methode in mainwindow.cpp is not very different from the method in tutorial01.cpp.
I only wanted to split some parts for a better overview =/


Works fine.