Difference between revisions of "Mix Vector"
(Conformed layout & updated GUI image.) |
|||
Line 1: | Line 1: | ||
− | + | <div style="float:right; border-style:solid; padding:20px"><categorytree mode=pages hideroot=off>Mix</categorytree></div> | |
− | + | [[File:MixVector_00_GUI.png|none|470px|Mix Vector]] | |
+ | |||
+ | |||
+ | ==Overview== | ||
+ | The Mix family of nodes is used to blend or interpolate between the two input values. If the value coming from the node attached to the Mix controller input is 0 then the value of the Input node will be output. If the value coming from the Mix controller node is 1 then the value of the Input 2 node will be output. If the Mix controller value is somewhere between 0 and 1 then the output will be a blended combination of the two input values.<br /><br /> The inputs are mixed using linear interpolation according to the following formula:<br /><br /> Output '''<nowiki>=</nowiki>''' Input '''+''' Mix controller value '''x''' (Input 2 '''-''' Input)<br /><br /> Mix colour mixes colours on a component-wise basis. The Mix controller can be either a colour or a scalar:<br /><br /> Output.red = Input.red '''and''' Input 2.red '''mixed by the''' Mix controller's red value<br /> Output.green = Input.green '''and''' Input 2.green '''mixed by the''' Mix controller's green value<br /> Output.blue = Input.blue '''and''' Input 2.blue '''mixed by the''' Mix controller's blue value<br /><br /> Mix vector mixes vectors on a component-wise basis, but the Mix controller value is always converted to a scalar if it is not already a scalar:<br /><br /> Output.x = Input.x '''and''' Input 2.x '''mixed by the''' Mix controller's scalar value<br /> Output.y = Input.y '''and''' Input 2.y '''mixed by the''' Mix controller's scalar value<br /> Output.z = Input.z '''and''' Input 2.z '''mixed by the''' Mix controller's scalar value<br /><br />'''Settings: '''<br /> | ||
* '''Input 2'''<nowiki>: This is where you specify the node for the Input 2 value.</nowiki> | * '''Input 2'''<nowiki>: This is where you specify the node for the Input 2 value.</nowiki> | ||
Line 12: | Line 16: | ||
* If there is no '''Mix controller''' node attached then a value of 0.5 is used for mixing the input values. | * If there is no '''Mix controller''' node attached then a value of 0.5 is used for mixing the input values. | ||
− | < | + | |
+ | <br /n> | ||
[[Category:Mix]] | [[Category:Mix]] |
Latest revision as of 23:35, 5 April 2022
Overview[edit]
The Mix family of nodes is used to blend or interpolate between the two input values. If the value coming from the node attached to the Mix controller input is 0 then the value of the Input node will be output. If the value coming from the Mix controller node is 1 then the value of the Input 2 node will be output. If the Mix controller value is somewhere between 0 and 1 then the output will be a blended combination of the two input values.
The inputs are mixed using linear interpolation according to the following formula:
Output = Input + Mix controller value x (Input 2 - Input)
Mix colour mixes colours on a component-wise basis. The Mix controller can be either a colour or a scalar:
Output.red = Input.red and Input 2.red mixed by the Mix controller's red value
Output.green = Input.green and Input 2.green mixed by the Mix controller's green value
Output.blue = Input.blue and Input 2.blue mixed by the Mix controller's blue value
Mix vector mixes vectors on a component-wise basis, but the Mix controller value is always converted to a scalar if it is not already a scalar:
Output.x = Input.x and Input 2.x mixed by the Mix controller's scalar value
Output.y = Input.y and Input 2.y mixed by the Mix controller's scalar value
Output.z = Input.z and Input 2.z mixed by the Mix controller's scalar value
Settings:
- Input 2: This is where you specify the node for the Input 2 value.
- Mix controller: This is where you specify the node that is used to control the mixing between the Input and Input 2 values. If you do not specify a mix controller, a value of 0.5 is used.
Error conditions
- It is an error for there to be no Input value. In this case 0 is output for scalars, and colours and vectors will have all their components set to 0.
- It is an error for there to be no Input 2 value. In this case the Input value is output.
- If there is no Mix controller node attached then a value of 0.5 is used for mixing the input values.
A scalar is a single number. 1, 200.45, -45, -0.2 are all examples of scalar values.
A vector is a set of three scalars, normally representing X, Y and Z coordinates. It also commonly represents rotation, where the values are pitch, heading and bank.