[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Rotate image around another point?
- To: pygame-users@xxxxxxxx
- Subject: Re: [pygame] Rotate image around another point?
- From: "Ulf Ekström" <uekstrom@xxxxxxxxx>
- Date: Thu, 19 Apr 2007 11:02:20 +0200
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Thu, 19 Apr 2007 05:02:47 -0400
- Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=muuCXh1UmRUEd4+KQLO4M87JYBTNvHHB8eTvisK4SYYALqLE6fWvgkvA1gX2Wzuyw2Usow0QF6d3PnHg9KcxoxY4x8AO0THQjGCKDUmcF0p8BzhjVE8L+PGQeCWMjilsjjPlkLWXBJQeL6lFzRq5hKEnQ+gO67AHYKcW4x4n0GQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=qpBWHSaSgJV/iCnUbNmRO+ALEgpoQYzBwzuHMOvpgb9P+hMkXXi5ocdlCDUOtr0ZuniEb1rmlKJsKprRwgdb/Yejhx0eH5no1k6PaVZGYMZjjGVdg95k8RYAsIDD+53m2wq7oiVjTZ20I5VsmdfXgaTdLk/dFldT0MRPk5mfj+g=
- In-reply-to: <1176972588.6550.8.camel@localhost>
- References: <1176969199.6550.3.camel@localhost> <46272A24.9030502@gmail.com> <1176972588.6550.8.camel@localhost>
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
On 4/19/07, John Eriksson <john@xxxxxxxxxxxx> wrote:
Well, no.
I'm looking for a way to rotate the imagedata (like
pygame.transform.rotate(...)) but your example rotates the image
location. Right?
It is actually the same thing. Rotation around some arbitrary point
can be decomposed into a rotation around some other point followed by
a translation. Suppose you have a function R which rotates things
around the origin. To write a function Rp which rotates around the
point p (p and q are vectors), you do
Rp(q) = R(q-p)+p
Since R is a linear function you can do
Rp(q) = R(q) + p - R(p)
So rotating around p is the same as rotating around the origin and
then translating by p - R(p).
Ulf