by Slim » Sep 28, 2004 @ 1:50pm
Yes, it's a good idea to specify three corners and calculate the fourth.
The problem is that I don't want to mess around with the matrix without guidance (I actually don't understand how it works).
Let's say I want to use BlitStretch and create a surface with corners on (0,0) (100,0) (10,100) (110,100). The source is a Rect(0,0,100,100).
What should the matrix look like? Today the matrix in BlitStretch(...):
T[0][0] = rx;
T[0][1] = 0;
T[1][0] = 0;
T[1][1] = ry;
T[2][0] = -destRect.left * rx + (srcRect.left << 10);
T[2][1] = -destRect.top * ry + (srcRect.top << 10);
How should each element in the matrix in my case be calculated? It should be a general solution to it, shouldn't it?
Once again thanks for replying and sorry for causing so much trouble about this stretching-thing.