[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [pygame] Rotating Images on a specified axis.
Caleb Mahase wrote:
I am already using the rotate function. From what I understand, 
rotozoom distorts the image.
Patrick Mullen wrote:
Rotate will distort the image as well, unless you rotate in 90 degree 
increments.  Make sure to always rotate based on the source, and not 
off of previous frames of the rotation.  Rotate is unfiltered, and 
won't look as good as rotozoom; rotozoom is slower I believe.
Also, note that rotozoom will cause less distortion than either scaling 
followed by rotation or rotation followed by scaling.  For best visual 
results, if speed is not a major concern, start with a source image with 
twice the resolution that you actually need, then rotozoom it to the 
size and orientation you want.  As Patrick mentions, you must do your 
rotozoom from a source image rather than accumulating rotations, since 
each rotozoom will add more distortion.
Another thing to keep in mind is that rotation will cause the size of 
the rectangle to change, as well as the position of the center of 
rotation relative to the upper-left corner for reasons that should be 
geometrically obvious.  If you do a little geometry on a piece of paper, 
you can figure out the correction for this.
- Ken Seehart