W3C home > Mailing lists > Public > www-svg@w3.org > February 2006

calcMode="linear" with numeric and non-numeric values

From: Cameron McCormack <cam-www-svg@aka.mcc.id.au>
Date: Tue, 7 Feb 2006 11:15:21 +1100
To: www-svg@w3.org
Message-ID: <20060207001521.GB21394@port.mcc.id.au>

Hi.

I have a question about animations when calcMode="linear" and some of
the values specified can not be interpolated.  SMIL Animation states[1]:

  The default mode is "linear", however if the attribute does not
  support linear interpolation (e.g. for strings), the calcMode attribute
  is ignored and discrete interpolation is used.

It's obvious then that in this example:

  <animate attributeName="xlink:href" dur="2s" calcMode="linear"
           values="#a, #b"/>

that since URLs cannot be linearly interpolated, the attribute should be
set to #a from 0s to 1s and #b from 1s to 2s.  But what happens if an
attribute that does support linear animation is animated with some
values that cannot be interpolated?

  <animate attributeName="opacity" dur="6s" calcMode="linear"
           values="inherit; 0; 1"/>

'opacity' is an attribute that does support linear interpolation, so
according to the quoted paragraph above calcMode is not ignored, but
obviously interpolation cannot happen between 'inherit' and '0'.  So
what should happen?  Three possibilities I can think of:

  * Do treat it as if calcMode="discrete" were specified, because at
    least one non-numeric value was given:

      'inherit' from 0s to 2s
      '0'       from 2s to 4s
      '1'       from 4s to 6s

  * Treat it the same as calcMode="linear", but don't actually do any
    interpolation between 'inherit' and '0':

      'inherit' from 0s to 3s
      '0'..'1'  from 3s to 6s

  * Treat it like a separate calcMode="discrete" between 'inherit' and
    '0' and calcMode="linear" between '0' and '1', distributing the
    segments equally:

      'inherit' from 0s to 2s
      '0'       from 2s to 4s
      '0'..'1'  from 4s to 6s

I like the second choice, but if there is some text that defines what
happens in a case like this then a pointer would be appreciated.

Thanks,

Cameron

[1]
http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimFuncCalcMode
[2]
http://www.w3.org/TR/SVG11/animate.html#AnimationAttributesAndProperties

-- 
 Cameron McCormack			ICQ: 26955922
 cam (at) mcc.id.au			MSN: cam (at) mcc.id.au
 http://mcc.id.au/			JBR: heycam (at) jabber.org
Received on Tuesday, 7 February 2006 00:15:31 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:14:53 UTC