C

matrix4x4 QML Basic Type

A 4-row and 4-column matrix. More...

Methods

  • matrix4x4 plus(matrix4x4 other)
  • matrix4x4 times(real factor)
  • matrix4x4 times(matrix4x4 other)

A matrix4x4 type has sixteen values, each accessible via the properties m11 through m44 in QML (in row/column order). Values of this type can be composed with the Qt.matrix4x4() function. Each attribute in a matrix4x4 is stored as a real (single-precision).

This basic type is provided by the QtQuick import.

Method Documentation

matrix4x4 plus(matrix4x4 other)

Returns the matrix4x4 result of the addition of this matrix4x4 with the other matrix4x4

var a = Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
var b = Qt.matrix4x4(5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20);
var c = a.plus(b);
console.log(c.toString());
// Matrix4x4(6, 8, 10, 12, 14, 16, 18, 20, 22,
// 24, 26, 28, 30, 32, 34, 36)

matrix4x4 times(real factor)

Returns the matrix4x4 result of multiplying this matrix4x4 with the scalar factor

var a = Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
var b = 4.48;
var c = a.times(b);
console.log(c.toString());
// Matrix4x4(4.48, 8.96, 13.44, 17.92, 22.4, 26.88, 31.36, 35.84,
// 40.32, 44.8, 49.28, 53.76, 58.24, 62.72, 67.2, 71.68)

matrix4x4 times(matrix4x4 other)

Returns the matrix4x4 result of multiplying this matrix4x4 with the other matrix4x4

var a = Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
var b = Qt.matrix4x4(4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19);
var c = a.times(b);
console.log(c.toString());
// Matrix4x4(120, 130, 140, 150, 280, 306, 332, 358, 440, 482,
// 524, 566, 600, 658, 716, 774)

Available under certain Qt licenses.
Find out more.