Open Inventor - Engines
for the Workshop ----on Apr. 4th & 5th,
and the Workshop ----on Jul. 17th & 18th.
Engines
Engines are classes of Open Inventor objects. You
use them in the following situation.
- You want to animate your Open Inventor objects.
- You want to establish one part of your objects
connections with some other parts of your objects.
Structure of Engines
Types of Engines & Their Fields
The followings are some examples of engines grouped according to
their operations.
- Arithmetic engines
- SoCalculator
- SoBoolOperation
- SoInterpolateFloat, SoInterpolateRotation, SoInterpolateVec2f,
SoInterpolateVec3f, SoInterpolateVec4f
- SoTransformVec3f
- SoComposeVec2f, SoDecomposeVec2f, SoComposeVec3f,
SoDecomposeVec3f, SoComposeVec4f, SoDecomposeVec4f,
SoComposeRotaion, SoDecomposeRotaion, SoComposeMatrix, SoDecomposeMatrix
- SoComputeBoundingBox
- Animation engines
- SoElapsedTime
- SoOneShot
- SoTimeCounter
- Triggered engines
- SoCounter
- SoOnOff
- SoTriggerAny
- SoGate
- Engines used for array mannipulation
- SoSelectOne
- SoConcatenate
Animation Engines
Of course, Animation Engines are used for animating objects. Animation is
related to time deeply, so each of engines is related to realTime global field.
Elapled-Time Engine
If you want to use time, this engine will help you. This is a basic, but
important stopwatch.
Inputs
- SoSFTime timeIn (For running time)
- SoSFFloat speed (For speed)
- SoSFBool on (When it is TRUE, it starts runnning. When it is FALSE, it stops.)
- SoSFBool pause (When it is TRUE, it stops temporarily. When it is FALSE, it continues running.)
- SoSFTrigger reset (For resetting)
Outputs
- SoSFTime timeOut (Elapsed or changed time)
One-Shot Engine
This engine is for time, too. In case of this engine, you can use preset timer.
Inputs
- SoSFTime timeIn (For running time)
- SoSFTime duration (For duration)
- SoSFTrigger trigger (To start the cycle)
- SoSFBitMask flags (To control flags)
- SoSFBool disable (When it is TRUE, the timer is disabled.)
Outputs
- SoSFTime timeOut (Elapsed time)
- SoSFBool isActive (When the cycle is active, it is TRUE.)
- SoSFFloat ramp (A float value from 0.0 (when the trigger starts) to 1.0 (when the duration is reached))
Time-Counter Engine
Another engine for time (for animation) is a Time-Counter Engine. This is
for the time-counter. Its output is the current count, so you can
synchronize one event with another event. This is its distinctive feature.
Inputs
- SoSFTime timeIn (For running time)
- SoSFShort min (For the minimum value of the counter)
- SoSFShort max (For the maximum value of the counter)
- SoSFShort step (For the step value of the counter)
- SoSFBool on (When it is FALSE, the conter pauses.)
- SoSFFloat frequency (For number of the circle related to min and max)
- SoSFFloat duty (For the value of the duty circle)
- SoSFShort reset (To reset the counter)
- SoSFTrigger syncIn (To restart at the first point of the cycle)
Outputs
- SoSFShort output (To count min and max)
- SoSFTrigger syncOut (To trigger at the first point of the cycle)
Samples of Animation Engines
- First, this is a draft without engines.
(source file)
- Sample 1 with Animation Engine.
(source file)
It uses an Elapled-Time Engine.
You can use this Makefile
if you want to compile all of sample files. Please command "smake."
(NOTICE: The place where libraries exist may be changed.)
Explanation ; The timeOut output of the Elapsed-Time Engine
(myConter2) is connected a SoRotationXYZ field (myRotXYZ2). This field inserts
the timeOut value into Z slot of a vector.
Gate Engine
Gate Engine works like a gate which selects the value from the input and
copies it to output.
Inputs
- SoSFBool enable (It enables to continue passing through.)
- SoSFTrigger trigger (To copy one value)
- input (When the gate is open, this value is copied to the output.)
Outputs
- output (When the gate is open, this value includes a copy from
input.)
Samples of Gate Engine
- Sample 2 (binary file) with a Gate Engine.
(source file)
Please save the file, and execute it. (Don't forget to change permission.)
- Sample 3 (binary file)
with a Gate Engine and path.
(source file)
Please save the file, and execute it. (Don't forget to change permission.)
You can use this Makefile same as the above
thing.
Explanation ; In this case, this sample connects each of Elapsed-Time Engines
(myCounter and myCounter2) to each of Gate Engines (gatecube and gatecone).
- In case of Sample 2, pressing the left mouce button enables and disables
the gate engine (gatecube) and pressing the middle mouce button enables and
disables the gate engine (gatecone). Each of Gate Engines controls the
movement each of red a cube and a blue cone.
- In case of Sample 3, pressing the mouce button on the red cube enables
and disables the gate engine (gatecube) and pressing the mouce button on the
blue cone enables and disables the gate engine (gatecone). Each of Gate
Engines controls the movement each of red a cube and a blue cone.
- A difference between sample 2 and sample 3 is each of callbacks.
Arithmetic Engines
All inputs and outputs in Arithmetic Engines are multiple-value (MF) fields.
If you use values of type SoSF, they are changed to MF fields automatically.
Besides it, if inputs are arrays, outputs are also arrays. You can use
different values of inputs.
Boolean Engine
Boolean Engine operates Boolean operations.
For example, when you want one object to move depending on another object,
you should use Boolean Engine.
Inputs
- SoMFBool a (First argument to the Boolean operation)
- SoMFBool b (Second argument to the Boolean operation)
- SoMFEnum operation (The Boolean operation)
Outputs
- SoMFBool output (Result of the Boolean operation by inputs)
- SoMFBool inverse (Inverse of output)
Calculator Engine
Calculator Engine is for calculation similar to Boolean operations, but it is
for more general.
Inputs
- SoMFFloat a, b, c, d, e,
f, g, h (These inputs are the floating point
values.)
- SoMFVec3f A, B, C, D, E,
F, G, H (These inputs are the vectors.)
- SoMFString expression (The expression to be estimated)
Outputs
- SoMFFloat oa, ob, oc, od
(These outputs are the floating point values.)
- SoMFVec3f oA, oB, oC, oD
(These outputs are the vectors.)
Other Samples
- KeyAnimation is an example using keyboard actions. It uses a Calculator Engine, a Compose Engine, and a One-Shot Engine.
(by Prof. Herder)
- This sample file includes 3 letters going
round a chair. (They play musical chairs, and the letter S is always a winner.)
Here is an iv file.
I refered to "The Inventor Mentor" written by Josie
Wernecke. (published by ADDISON - WESLEY PUBLISHING COMPANY)
s1021019@u-aizu.ac.jp