Friday, June 5, 2009

MAKING A FIRE !

PYGAME FIRE

Trying to animate a fire , using python game platform , pygame. I got the fire 'to life' by combining together 16 different sketches or 'sprites'. The primary plume and the wood being the static parts while the other smaller portions of the flame being in repetitive motion. Black is used as background for best contrast.

Fig1.Fire, Screen-Shot 1

Fig2. Fire , Screen-Shot 2

Superimposing the main plume with 14 other minor plume allows creating a seeming movement of the flames upward.


Fig 3. Without the main plume (14 minor plumes and the wood)


Video 1. PyGame Fire

The 'effect' is created by motion of the 14 sprites both in horizontal and vertical axis and the variation of the colour. Not often 16 different pieces are sewn together to form an animation in PyGame.

Some tweaking has to be done with the various parameters in order to 'liven-up' the fire.

REFERENCES


(1) Source code and sketches , http://code.google.com/p/pygame-fire/downloads/list

2 comments:

Unknown said...

Root of the flame should be stable and stationary.

Proper colouration to be done - transition from vermilion red to golden yellow. Individual tips of the flame should have more natural and wavy flickering.

Please add and show.

- Baba

Arkapravo Bhaumik said...

Yeah ! I agree .... however I am colour blind ! and such contrasts cannot be made out by me !