cumulative animation examples

Hello,

I noticed two confusing examples in 
SMIL2.1:3.5.4:

***citation begin***
From-to and from-by animations also support cumulative animation, 
as in the following example:
<rect width="20px"...>
   <animate attributeName="width" dur="5s" from="10px" to="20px"
      accumulate="sum" repeatCount="10" />
</rect>

The rectangle will grow from 10 to 20 pixels in the first 5 seconds, 
and then from 20 to 30 in the next 5 seconds, and so on up to 110 
pixels after 10 repeats. Note that since the default value for additive 
is replace, the original value is ignored. The following example 
makes the animation explicitly additive:
<rect width="20px"...>
   <animate attributeName="width" dur="5s" from="10px" to="20px"
      accumulate="sum" additive="sum" repeatCount="10" />
</rect>

The results are the same as before, except that all the values are 
shifted up by the original value of 20. The rectangle is 30 pixels 
wide after 5 seconds, and 130 pixels wide after 10 repeats.
***citation end***

If I understand SMIL2.1:3.3.5 correctly, the description is
wrong, should be something like this for the first example:
"The rectangle will grow from 10 to 20 pixels in the first 5 seconds, 
and jumps to 30 at 5s, then it grows from 30 to 40 in the next 5 
seconds, jumps to 50 and so on up to 200 pixels after 10 repeats"
and for the second:
"The results are the same as before, except that all the values are 
shifted up by the original value of 20. The rectangle is 30 pixels 
wide at 0s, grows up to 40 in 5 seconds, jumps to 50 at 5s and 
so on, and is 220 pixels wide after 10 repeats."

Because (SMIL2.1:3.3.5)
"Each subsequent iteration adds to the result 
of the previous iterations"
and
"To avoid jumps, authors will typically choose 
animation functions which start at 0."

To get the described behaviour of the second example one has
to write something like this:
<rect width="30px"...>
   <animate attributeName="width" begin="5s" dur="5s" by="10px"
      accumulate="sum" repeatCount="10" />
</rect>
or with two animations to get the underlying value 20px unchanged
for non animating viewers:
<rect width="20px"...>
   <set attributeName="width" begin="5s" to="30px" />
   <animate attributeName="width" begin="5s" dur="5s" from="0px" to="10px"
      accumulate="sum" additive="sum" repeatCount="10" />
</rect>


 
To get a similar behaviour as in the first example, I think there
are two animations necessary in SMIL2.0 or 2.1 to get the following
behaviour:
1. initial animation value not zero
2. no jumps
3. static attribute value replaced by an animation 

<rect width="20px"...>
   <set attributeName="width" begin="0s" to="10px" />
   <animate attributeName="width" dur="5s" by="10px"
      accumulate="sum" repeatCount="10" />
</rect>
or 
<rect width="20px"...>
   <set attributeName="width" begin="0s" to="10px" />
   <animate attributeName="width" dur="5s" from="0px" to="10px"
      accumulate="sum" additive="sum" repeatCount="10" />
</rect>

A simpler method for cumulative continuous animations 
using non zero from values was available with
SMIL animation recommendation 04-September-2001,
but this was changed in later SMILs.
The open questions are: Was it the intention of SMIL2.0/2.1
just to correct wrong examples in the previous SMIL
animation recommendation or was it a special rule in
this recommendation, skipped in the later SMIL2.0/2.1 
just with an incomplete correction of the examples? Or
was the special rule just forgotten in  SMIL2.0/2.1
and accidently overwritten with a more general rule?
What is to do for SVG-viewers? To support the
initial behaviour for SVG1.0/1.1 and to support the
different behaviour for the upcomming SVG1.2?
Or should they just give a warning, that the behaviour 
of those animations are not defined consistently in 
specification? Different treatment of non zero 'from'
values in SVGs using different version numbers will
cause problems with developers. I think they prefer to
implement the same behaviour for all versions for the
same attributes and values. Anyway it would to nice
to get clarified, what correct accumulative behaviour in 
the different versions is...

Best wishes

Received on Friday, 12 May 2006 14:17:34 UTC