Quote from: Hetzen on March 11, 2010, 06:24:29 AM
Thanks Mogn. Conditionals have a logic I can understand. I'm afraid I don't understand....
"Subtract vector"("Add vector"([X1,X2,X3],[Z1,Z2,Z3]), "Difference colour"([X1,X2,X3],[Z1,Z2,Z3)) == 2*[min(X1,Z1), min(X2*Z2),min(X3,Z3) ]
...or how to write that in node form. I would seriously appreciate it if you could explain this to me step by step if you get the time. Something I don't like about the Conditional Function, is the amount of hoops you have to jump through to get a smooth cut-off between your logic argument. ie, if x > 10 then smoothly mix to y over 10 meters.
The notation [X1, X2, X3] means a vector with the values x=X1, y=X2, z= X3
So the top (first level) of the node networks starts with two "Build vector" or "Constant vector"
The second level level contains an "Add vector" where the two inputs are connected to output of the two vectors in the first level.
So the output of this node is [X1+Z1, X2+Z2, X3+Z3]
The second level also contains a "Difference Colour" the inputs in this node is also connected to the outputs of the nodes in the first level.
There is no difference in TG2 between vectors and colours. The output if this node is [max(X1,Z1)-min(X1,Z1), max(X2,Z2)-min(X2,Z2), max(X3,Z3)-min(X3,Z3)]
In the attached picture node the network the example shows the two input vectors with the values [7, 13, 15] and [4,16,12]
the values of the second level are thus [11=7+4, 29=13+16, 27=15+12] and [3=7-4, 3=16-13, 3=15-12]
The third level consist of a "Subtract vector", the left input is connected to the output of the "Add vector" in level 2,
and the right input is connected to the output of the "Difference node" in the second level.
The output of this node is thus [X1+Z1-(max(X1,Z1)-min(X1-Z1)), X2+Z2-(max(X2,Z2)-min(X2-Z2)), X3+Z3-(max(X3,Z3)-min(X3-Z3))]
This shows that the max values are subtracted from the sum, and the minimum valuse are added to the sum, leaving the twice the minimum components.
If and "Add vector" is used instead of a subtract, the minimum values ar subtracted from the sum, and the maximum values added to the sum, thus leaving
the maximum of the components.