I think I found a solution that calculates the transformation matrix step by step.
So far, the trance describes a parallelogram transformation. In this parallelogram, I find p4 (relatively) in the next step. I think this can be done using a direct formula that is not related to the inverse of trans.
The x and y values ββare hard to explain. Given only one of them (the other is 1 ), this determines the relative scaling of only p4 . But the combination of perspective x and y transformation, the meaning of x and y is difficult; I found the formulas by trial and error.
Some tests have shown that this leads to the correct results. However, I did not test special cases, such as those where two points are equal or one of them is on a line segment between the other two; I think this decision may break in such situations.
Therefore, I'm still looking for some direct formulas for the values ββof the matrix m11 , m12 ... m33 , given the point coordinates p1.x() , p1.y() ... p4.x() , p4.y() .
leemes
source share