[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[pygame] flaming examples



i've got some fun with numeric python testing.
the algorithm used in the SDL xflame demo has been eluding
me for quite awhile. i've finally got the same algorithm
working well in pygame with numeric.

the xflame demo uses a cool looking algorithm that's a
bit trickier to get working quickly in python. i've got it
running at a little over 30fps which is decent, but the
resolution is pretty small. (but hey, just like xflame defaults)

included in the zip is a second flame demo that uses a
different algorithm, but runs at about 100fps. doesn't look
as good, but makes up in speed.

for those of curious to see how numeric python can be used
for pixel-level effects like this, go ahead and take a peek
at the source. sadly, i'm afraid it's a bit complicated for
"beginning" work.

i've named the functions that do the work similarly to the
SDL version in C. it may help you get an apples for apples
comparison.


you can download and try the pygame examples here
http://pygame.seul.org/ftp/contrib/flames.zip


a screenshot and source for the SDL xflame example are here
http://www.libsdl.org/projects/xflame/index.html


obviously the C version is a bit quicker. nonetheless, its
good to see python is not totally worthless in this area.


____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org