blend_node_data

Synopsis

Inputs two compatible fields (node data only) and blends (interpolates) between the two using a ratio value. A ratio of 0.0 outputs the first field's node data. A value of 1.0, outputs the second field's node_data. Values inbetween will produce an output containing node data linearly interpolated between each corresponding node. For example, a value of 0.3 will use 70% of the first field, and 30% from the second field.

Input Ports

Name Type Description

&in1 Node_Data First input node data
&in2 Node_Data Second input node data

Parameters

The following lists all of the parameters found in the parameter block BlendParams, which are accessed by the module BlendNodeData and the UI Macro BlendUI.

Name Type Description UI Control

ratio float Ratio for interpolation between in1 and in2 Blend Ratio

Output Ports

Name Type Description

out Node_Data Output data containing interpolated node data

Description

The blend_node_data macro may be used to linearly interpolate node data from two compatible input fields. Only node data is required for the inputs, but these must have the same number of components and nodes, and each component must have the same data type and vector length.

The output node data is of equal size and consists of the same components. Only the actual node data values themselves are changed. The linear interpolation is only performed on the values of the input node data, and does not take into account the coordinate position of the nodes. As such it used instead of the existing interpolate macros/modules in AVS/Express which perform interpolation based on coordinate space (by placing a probe mesh into an existing field).

The ratio parameter is used to determine the balance between the first and second inputs, and hence the value placed into the output node data. At 0.0, only the data from the first input is used. As the ratio value increases towards 1.0, the second input has more influence.

One possible use for blend_node_data is to augment the animate_filename IAC project, so that interpolation may be performed between successive input files in a sequence of files.

Input Ports

&in1

First input Node_Data which is processed by the module.

&in2

Second input Node_Data which is processed by the module, and must be compatible with the first input field (as detailed above).

Parameters

ratio

The blending ratio for generating the output node data. The ratio ranges from 0.0 to 1.0, with 0.0 corresponding to 100% of input 1, and 1.0 corresponding to 100% of input 2.

Output Ports

out

Output of the blended (linearly interpolated) node_data.

Utility Macros

The low-level BlendNodeData module is used in this User Macro blend_node_data.

Example

An example application BlendNodeDataEg is provided, which inputs two sample fields, and bounces (loops) the ratio between 0.0 and 1.0, and outputs the interpolated field to the surf_plot macro. The example shows blending between the figures '1' and '2'.

Files

iac_proj/blend/blndmacs.v contains the blend_node_data User Macro, the Blend Functional Macro, the BlendUI UI Macro, and the example application BlendNdeDataEg V definitions.

Other Notes

The BlendNodeDataMacs library inherits its process. As this library contains no procedural code, the process is not important. The low-level BlendNodeData module, executes under the process specified in its library, not the process defined in the high-level library.

Author

Paul G. Lever
International AVS Centre

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL

See Also

BlendParams, BlendUI, Blend and BlendNodeData.