TimeCounter
engines are animation engines that produce
cyclic output. They start counting from some start value to some
stop value, generating output while counting, and after reaching
the stop value the engine starts again from the beginning.
The important input fields are:
min
: the minimum (integer) value of the count.max
: the maximum (integer) value of the count.step
: the increment at each step (default is 1).frequency
: The (floating-point) number of cycles of
counting from min
to max
per second.
The important output field is:
output
: the current (integer) value of the count.
Here is a complete Inventor .iv file for a simple example where the
radius of the base of a cone changes in response to the output of a
TimeCounter
engine. Just cut and paste the text into a file
named test.iv
and then do ivview -q test.iv
:
#Inventor V2.0 ascii Separator { PerspectiveCamera { position 0 1 10 } Cone { bottomRadius = TimeCounter { min 0 max 3 frequency 0.2 } . output height 2 } }
You should note several things about this example:
bottomRadius
field actually requires a floating-point
number, but the output
field it is connect to produces an
integer value. Thankfully, in Open Inventor the integer values are quietly
converted into floating point values when necessary, which is why this
example works.
bottomRadius
value will alternate between 0.0, 1.0,
2.0, and 3.0, before starting the cycle again. A cone with a bottom
radius of 0.0 is no cone at all, which is why the image will disappear
whenever the TimeCounter
engine starts a new counting
cycle.
frequency
field to 0.2 means that one complete
counting cycle will take 1 cycle / 0.2 cycles-per-second = 5 seconds.