Re: Population simulations using SVG animation

On Oct 13, 2006, at 9:05 AM, Philip Rhoades wrote:

> I want to be able to make the populations dynamic (changing for each
> generation) which will affect the position and diameter of each circle
> ie the sub-pops can be moving, growing & shrinking i.e. the circles  
> are
> animated.  This of course may also mean the fill colours would  
> change if
> the overlapping of the sub-pops changes.
>
> Could someone direct me to the most sensible way of coding this? - ie
> direct me to some code that will animate one circle to begin with  
> (size
> and position).
>

Check out the source SVG for: http://phrogz.net/svg/grusn.svgz
(There's also a 2.4MB un-gzipped version here: http://phrogz.net/svg/ 
grusn.svg)

See all the <animate> elements in the file. I don't have the circles  
changing size or color (only position), but the SMIL syntax is very  
similar and easy to extrapolate.


Alternatively, write out a static SVG file and write out the results  
of all your animations as data in JS embedded in the the SVG, and  
have the JS control the SVG DOM. For a simple example: http:// 
phrogz.net/svg/circleanim.svg


Or, you could have JS controlling the SVG load the animation data  
from a separate XML source. (Don't have a simple example showing  
that, but it, you know, just coding. :)

Received on Monday, 16 October 2006 03:38:39 UTC