HomefieldOfView | SPi-V dev

Legend

  • required
  • not yet implemented

Navigation

user

<ramp>

Description

A ramp node is a signal generator. The signal it generates is either a classical sawtooth ( /|/|/| ) or a triangle ( /\/\/\ ), depending on the pingpong value. The shape of the signal can be smoothened using dampening parameters. The signal 'fires' once or loops.

The signal can be used by behavior nodes, either by triggering them periodically, or by feeding a value into them. Behaviors can be either referenced using the behavior attribute, or inlined as a child of the ramp.

Syntax

<tour>
  <scene>
    <panoelement id="nodeID" ...\>
    ...

    <ramp id="rampID" behavior="someBehavior" 
      value1="0" value2="1" duration="5" loop="true" active="false" />
    ...
  </scene>
  ...

</tour>

Attributes

  • id
    Unique id to reference the ramp by.
  • active
    Turns the signal on or off.
    Values: true or false, defaults to false
  • value1
    Specifies one of the two values to interpolate to and from.
    Values: numeric, defaults to 0
  • value2
    Specifies one of the two values to interpolate to and from.
    Values: numeric, defaults to value1 + 1
  • value
    Specifies the value when the ramp is initialised.
    Values: numeric, between value1 and value2
  • minvalue
    Specifies a minimal value for the ramp to generate. If both minvalue and maxvalue are specified, the computed value will be wrapped between these two limits.
    Values: numeric, between value1 and value2
  • maxvalue
    Specifies a maximum value for the ramp to generate. If both minvalue and maxvalue are specified, the computed value will be wrapped between these two limits.
    Values: numeric, between value1 and value2
  • duration
    Controls the time in seconds it should take to reach value2 from value1 or vice versa.
    Ignored if maxstep or stepincrease are specified.
    Values: >0, defaults to 1
  • maxstep
    Controls the maximum step on each iteration for value to reach its destination value (either value1 or value2, depending on direction), effectively setting the maximum steepness of the signal as an alternative to the duration.
    Values: >0
  • stepincrease
    Dampens the step on each iteration. The step value is increased on each iteration until it reaches maxstep (if specified) or until step needs to decrease to smoothly reach its destination.
    Values: >0
  • direction
    Specifies the (initial) direction of the signal.
    Values: 1 (towards value 2) or -1 (towards value1)
  • pingpong
    Specifies whether the signal has a sawtooth or triangle shape.
    Values: true (triangle, /\/\/\/\) or false (sawtooth, /|/|/|/|), defaults to false
  • loop
    Specifies whether the signal continues after value reaches either value1 or value2.
    Values: 1 or higher, ot 'true'. If set to 'true', sounds loops indefinately. Defaults to false.
  • interrupt
    Specifies whether the signal can be interrupted by pressing a mousebutton, a key and/or moving the mouse. If the ramp is interrupted, value will be reset to the value opposite direction (ie: if direction=1, value will be reset to value1).
    Values: "hover", "press", "key" (or a comma-delimitted combination such as "press,key"

Events

  • start
    Fires when value is set to true.
  • stop
    Fires when value reaches its target value and loop = false.
  • loop
    Fires when value reaches its target value and loop = true.
  • change
    Fired when value has changed while the ramp was active (on each iteration).
  • interrupt
    Fired when the ramp is interrupted (see interrupt attribute).

Children

History

  • 18-Dec-07: Added minvalue, maxvalue
  • 22-Nov-07: Added loop=n, fixed code example
  • 14-Oct-05: Move towards more complete documentation
  • 20-Oct-04: Changed name to ramp
  • 03-Aug-04: Initial version

typo ...

Hi Aldo,
In the above description, "interupt" is misspelled.

SPi-V is working correctly with "interrupt" in both, "attribute" and "event" section.

Regards
Brigitte

oops

fixed

Re: <ramp>

hi aldo,

in the syntax i think there is a type mistake. period="5" should be duration="5"

Mahboob

Re: <ramp>

minvalue maxvalue attributes (introduced in 1.4.1) missing

Re: <ramp>

added, thanks.