C++ (Qt)// матрица "из локальной в мир"QMatrix4x4 BuildMatr( const QVector3D pt, const QVector3D & normal ){ qsrand(0); QVector3D axisZ = normal.normalized(); QVector3D axisX(qrand(), qrand(), qrand()); QVector3D axisY = QVector3D::crossProduct(axisZ, axizX).normalized(); axisX = QVector3D::crossProduct(axisY, axisZ); QMatrix4x4 m; m.setRow(0, axisX); m.setRow(1, axisY); m.setRow(2, axisZ); m.setRow(3, QVector4D(pt, 1)); return m;}