IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Matrix4x4 QML Type

Provides a way to apply a 4x4 tranformation matrix to an Item.

This type was introduced in Qt 5.3.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Matrix4x4 QML Type

  • Import Statement: import QtQuick

  • Since:: Qt 5.3

  • Group: Matrix4x4 is part of qtquick-visual-transforms

Detailed Description

The Matrix4x4 type provides a way to apply a transformation to an Item through a 4x4 matrix.

It allows for a combination of rotation, scale, translatation and shearing by using just one tranformation provided in a 4x4-matrix.

The following example rotates a Rectangle 45 degress (PI/4):

 
Sélectionnez
Rectangle {
    width: 100
    height: 100
    color: "red"

    transform: Matrix4x4 {
        property real a: Math.PI / 4
        matrix: Qt.matrix4x4(Math.cos(a), -Math.sin(a), 0, 0,
                             Math.sin(a),  Math.cos(a), 0, 0,
                             0,           0,            1, 0,
                             0,           0,            0, 1)
    }
}

Property Documentation

 

matrix : QMatrix4x4

4x4-matrix which will be used in the tranformation of an Item

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+