C++ (Qt)// build 3 normalized axes QVector3D axisZ = QVector3D::normal(a, b, c); QVector3D axisX = (b - a).normalized(); QVector3D axisY = QVector3D::crossProduct(axisZ, axisX); // save the axes into matrix QMatrix4x4 M; M.setRow(0, axisX); M.setRow(1, axisY); M.setRow(2, axisZ);
C++ (Qt)QVector3D center = matrix.inverted() * QVector3D();
C++ (Qt)local_point = matrix * source_point