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

Re: [pygame] New transformations for future Pygame releases



On Mar 9, 2008, at 10:58 AM, Richard Goedeken wrote:


Brian Fisher wrote:
If  were going to have something like that (a warping function) in
PyGame, I would definitely want it to use anti-grain-geometry
(http://antigrain.com ) rather than use a newly coded up function. AGG
has been around for a very long time, is highly tested, and once you
code up the basic integration issues a huge world of completely
awesome 2d software rendering falls out fairly easily (gaussian blur,
vector shape rendering, textured lines, etc. etc.)

I was previously unaware of this project; thanks for the link. It looks quite impressive. It appears that AGG does not have a function to do what Ian was asking for though - transforming a rectangle to an arbitrary quadrilateral. What it can do, though, is transform a rectange to an arbitrary parallelogram.

If I understand this screenshot correctly, I think it does do that:

http://antigrain.com/screenshots/perspective1.gif

(Labelled: 2D Bilinear transformations in a quadrangle)

It also seems to be able to do some non-linear distorts:

http://antigrain.com/screenshots/perspective5.jpg
http://antigrain.com/screenshots/distortions.jpg

very cool.

-Casey