|
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 PositionDamper node alows to smoothly move objects
around in the scene. It is used to animate fields of the SFVec3f type.
See the Damper PROTOs page for a general description of the Damper nodes.
EXTERNPROTO TexCoordDamper
[
eventIn MFVec2f set_input
field MFVec2f initial_input # []
eventOut MFVec2f output_changed
field MFVec2f initial_output # []
eventIn MFVec2f set_output
exposedField SFFloat tau # 1
field SFInt32 order # 1
field SFFloat eps # .001
eventOut SFBool isActive
eventOut SFBool isLoaded
]
"Dampers.wrl#TexCoordDamper"
|
|
|
Explanation of the fields:
eventIn MFString dataToStore
eventIn SFTime retreiveData
eventOut MFString retreivedData
eventOut SFTime nothingAvail
These fields perform the main access to the stack. If you send some data to dataToStore,
this data is put on top of the stack. If you send a value to retreiveData, one
piece of data is read from the stack. For a simple implementation the actual time value you send is irrelevant. If data could
be read, this is indicated at retreivedData. If no data could be read,
a time value is sent on nothingAvail.
eventOut SFInt32 length
This indicates the length of the stack, i.e. the number of data items stored in the stack.
Each time the length of the stack changes this indicates the new value.
exposedField SFInt32 maxLength -1
This field allows for limitting the maximum length of the stack. If maxLength is
-1, there is no limit on the number of items stored in the stack.
If maxLength is 0 or greater than 0,
this is the maximum number of data items stored in the stack. maxLength
can be changed on the fly. If it is set to a value lesser then the number
of items currently stored in the stack, the oldest ones are removed.
They don't come back if the limit is increased afterwards.
eventIn SFTime clear
This field allows for clearing the stack. When this receives a value, the
content of the stack is cleared immediately.
eventOut SFBool isLoaded
This field allows for load management of the EXTERNPROTO. Because VRML
browsers should ignore events that are routed to an EXTERNPROTO node that
is not yet loaded, some may get lost. The isLoaded
sends TRUE when the node has been loaded and
initialized.
The Demos:
Demo 1:
A texture is mapped on a grid and a Script node modifies an MFVec2f in order
to generate random texture coordinates. The output from the Script node
is sent through a TexCoordDamper in order to have the texture coordinates change smoothly.
Demo 2:
A texture with a picture is mapped on a grid. The user can click the image and drag the mouse similar to a warping animation.
With a TexCoordDamper the changes in texture coordinates are smoothed.
__.-.__ end of document
|