Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

How mvp matrices value are applied in Qt3D Example https://doc.qt.io/qt-5/qt3d-simplecustommaterial-example.html



  • How mvp (Model view projection) matrices are set in the code as mentioned in the above link code.

    Vertex shader:
    void main()
    {
    // Transform position, normal, and tangent to world coords
    worldPosition = vec3(modelMatrix * vec4(vertexPosition, 1.0));

    // Calculate vertex position in clip coordinates
    gl_Position = mvp * vec4(worldPosition, 1.0);
    

    }


Log in to reply