[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] blitting from-to surface with per-pixel alpha doesn't work...



On Monday 28 November 2005 11:00, Peter Shinners fired a shotgun at the 
keyboard and the following appeared:
> On Mon, 2005-11-28 at 11:29 +0100, D. Gyimesi wrote:
> > Anyway, the reason why I did choose the intermediate layer is that I
> > have a number of layers that I should rotate around different pivots.
> > If you take a look to the screenshot that show my sucking with
> > "compositing" ( http://www.cab.u-szeged.hu/~h370556/tc_shot.zip ) then
> > you can understand what I'm talkin' about.
>
> Each time you rotate an image you lose a little quality. You should get
> the best performance and quality by blitting each part directly to the
> target in the final position.
>
> What you are describing is traditionally handled with a transform stack.
> (Also called a matrix stack). The position and rotation of each piece is
> described with a transformation matrix. In this case a 3x3 matrix will
> be needed for 2D rotation and translation. The good thing is you can
> then combine multiple transforms into a single matrix.
<snip>

	Hrrmmmm.......is this really needed for 2D? I've been doing something along 
these lines (for collision detection, actually, though I'm drawing a bunch of 
little points in various places for debugging) and I've gotten away with just 
basic trig. I am using OpenGL actually, but I'm just figuring all my 
rotations and coordinates abstractly, arriving at final values and feeding 
them to glRotate/glTranslate once.

	-Matt Bailey