Home

hersto:  The Position2fDamper

 

Rant to the author:

    

Check for a response

Please note that This document is no longer up-to-date. (Though it is still valid.)

Please note that a more up-to-date document is available. A paper has been published that covers the topic in a more comprehensive way. It proposes besides the Damper nodes also the group of Chaser nodes that are usefull in cases where the Dampers fail.

To the paper: Linear Filters - Animating Objects in a Flexible and Pleasing Way

If you decide to continue reading this document, please keep in mind that now some fields on the Damper nodes have changed their name.

 

The Position2fDamper node is for the SFVec2f data type what the PositionDamper is for the SFVec3f data type. It allows to smoothly animate 2D coordinates.

EXTERNPROTO Position2fDamper
[
    eventIn      SFVec2f      set_input
    field        SFVec2f  initial_input           # 0 0

    eventOut     SFVec2f          output_changed
    field        SFVec2f  initial_output          # 0 0
    eventIn      SFVec2f      set_output

    exposedField SFFloat  tau                     # 1
    field        SFInt32  order                   # 1
    field        SFFloat  eps                     # .001

    eventOut     SFBool   isActive

    eventOut     SFBool   isLoaded
  ]
      "Dampers.wrl#Position2fDamper"
    
to the Position2fDamper demo

 

 

Explanation of the fields:

See the page about all Damper PROTOs. It contains a general description of the fields to which there is nothing to add to here.

 

The Demo:

The page provides a TouchSensor connected with a square. If you move the mouse over that square the texture coordinates are sent through a Position2fDamper to a Script node that converts it from SFVec2f to SFVec3f and drives the position of a little sphere. The tau field of the Position2fDamper node is set to 0.2 and the order field is set to 3. Thus the sphere smoothly follows the movements of the mouse pointer.

Surrounding the square there are four buttons. If you click on one of them the position of the button is sent to the set_output eventIn of the Position2fDamper. This makes the sphere jump to that button and move back to the position the mouse has left the square. Please note that while the mouse cursor is outside the square no texture coordinates are sent from the TouchSensor to the Position2fDamper.

If you download the Test_Position2fDamper.wrl and Dampers.wrl files to your local hard disk you can modify it in order to see the effects of setting set_output without setting set_input, setting set_input without setting set_output or setting both to the same value as well as the effects of varying tau and order fields.

__.-.__
end of document