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

About Matrix4x4 in QML



  • Hi, I am learning the Qt 3D module. I found the Qt.matrix4x4 provide different API than QMatrix4x4 in C++ side (by using F1 check the API doc).
    look likes Qt.matrix4x4 don't have such scale or rotation ... operations. even not in autocomplete.
    0ddff2d6-092d-4dda-95eb-fd695300be0f-image.png
    BUT! these functions do exist!

    var m = Qt.matrix4x4(1, 0, 0, -0.5, 0, 1, 0, 0, 0, 0, 1, 0.5, 0, 0, 0, 1)
    m.scale(2)
    console.log(m)
    // qml: QMatrix4x4(2, 0, 0, -0.5, 0, 2, 0, 0, 0, 0, 2, 0.5, 0, 0, 0, 1)
    

    https://doc.qt.io/qt-5/qmatrix4x4.html vs https://doc.qt.io/qt-5/qml-matrix4x4.html

    So Why??? And the type is QMatrix4x4...


Log in to reply