[Qt-interest] How to multiply a QTransform by float without affecting the scale?
K. Frank
kfrank29.c at gmail.com
Fri Jan 14 15:54:55 CET 2011
Hello Geovani -
On Fri, Jan 14, 2011 at 8:11 AM, Luiz Geovani Vier <lgvier at gmail.com> wrote:
> Thanks for the insights, K.
> I ended up using a trick to get the angle:
> QPointF pos1 = item->mapToScene(0, 0);
> QPointF pos2 = item->mapToScene(1, 0);
> float angle = MathUtils::angle(pos2 - pos1);
Yes, looks good. Thanks for the tip on the angle function. I didn't
know about it.
> MathUtils::angle is
> if (x == 0.f) {
> if (y < 0.f) return 270.f; else return 90.f;
> ...
Happy Hacking!
K. Frank
> Cheers,
> -Geovani
> On Wed, Jan 12, 2011 at 3:07 AM, K. Frank <kfrank29.c at gmail.com> wrote:
>>
>> Hi Geovani!
>>
>> On Tue, Jan 11, 2011 at 10:02 PM, Luiz Geovani Vier <lgvier at gmail.com>
>> wrote:
>> > Hello all,
>> > So I have a QTransform containing rotation and translation.
>> > I'd like to animate a transformation by multiplying the old matrix by
>> > 1.0 -
>> > [0..1] and new matrix by [0..1]. (btw, Is there a better way to do
>> > that?)
>> > ...
More information about the Qt-interest-old
mailing list