C++ (Qt)inline QVector3D Screen2CameraPoint( const QVector2D & screen, float scale, bool perspectiveFlag ){ if (perspectiveFlag) return QVector3D(screen.x(), screen.y(), -scale); else return screen / scale;}
C++ (Qt)void DrawTriangleRGB( QPainter & painter, const QPointF pt[3] ){ ???}
0.970676 -0.240318 -0.00594735 0.258948 0.240287 0.969228 0.0534803 -2.32853 -0.00708795 -0.0533411 0.998551 -43.4769 0 0 0 1
C++ (Qt)QMatrix4x4 GetTransform2D( const QVector3D & a, const QVector3D & b, const QVector3D & c ){ // находим ось поворота QVector3D normal = QVector3D::normal(a, b, c); QVector3D axis = QVector3D::crossProduct(normal, QVector3D(0, 0, 1)); // находим угол поворота // cos(angle) = dot(normal, QVector3D(0, 0, 1)) = normal.z float angle = acos(normal.z) * 180 / M_PI; // получаем матрицу поворота QMatrix4x4 M; M.rotate(angle, axis); // учтем смещение M.translate(-a); return M;}