Go to: Related nodes. Attributes.
This node uses standard vector/matrix mathematics. Say we have two input vectors, (a,b,c) and (d,e,f), and we are calculating the output vector (x, y, z). The calculations are defined as follows:
Dot Product is defined as follows:
Dot Product = (a*d) + (b*e) + (c*f)A dot product is a single value, so all three output values x, y and z will be set to the same thing.
The Cross Product of two vectors gives you a new vector. This new vector is guaranteed to be perpendicular (i.e. at right angles to) both of the input vectors.
Cross Product is defined as follows:
x = (b*f)-(c*e)
y = (c*d)-(a*f)
z = (a*e)-(b*d)
Note: If you just want to do simple component-by-component combinations of your vectors (i.e., x = a*d, y=b*e, z=c*f) then you should use the Multiply Divide utility node instead of the Vector Product utility node.
The Vector Matrix Product is useful for taking a vector in one coordinate space and moving it to another. For example, if you have a vector in camera coordinate space, you can multiply it by the Xform Matrix attribute of the camera. That will give you a new vector in world coordinate space.
Similarly, the Point Matrix Product is useful for taking a point in one coordinate space and moving it to another. For example, if you have a point in camera coordinate space, you can multiply it by the Xform Matrix attribute of the camera. That will give you a new point in world coordinate space.
Given an input vector (a, b, c) and an input matrix:
A B C D E F G H I J K L M N O P
Then Vector Matrix Product is defined as follows:
x = (a*A) + (b*B) + (c*C) y = (a*E) + (b*F) + (c*G) z = (a*I) + (b*J) + (c*K)And the Point Matrix Product is defined as follows:
x = (a*A) + (b*B) + (c*C) + D y = (a*E) + (b*F) + (c*G) + H z = (a*I) + (b*J) + (c*K) + L
In the table below, important attributes have their names listed in bold in the description column.
Node name | Parents | Classification | MFn type | Compatible function sets |
---|---|---|---|---|
vectorProduct | shadingDependNode | utility/general:drawdb/shader/operation/vectorProduct | kVectorProduct | kBase kNamedObject kDependencyNode kVectorProduct |
plusMinusAverage, reverse, chooser, choice, blend, blendTwoAttr, blendWeighted, blendDevice
input1, input1X, input1Y, input1Z, input2, input2X, input2Y, input2Z, matrix, normalizeOutput, operation, output, outputX, outputY, outputZ
Long name (short name) | Type | Default | Flags | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
input1
(i1 )
| float3 | 0.0, 0.0, 0.0 | ![]() ![]() ![]() ![]() ![]() | ||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
input2
(i2 )
| float3 | 0.0, 0.0, 0.0 | ![]() ![]() ![]() ![]() ![]() | ||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
matrix
(m )
| fltMatrix | identity | ![]() ![]() ![]() ![]() | ||||||||||||||
| |||||||||||||||||
normalizeOutput
(no )
| bool | false | ![]() ![]() ![]() ![]() ![]() | ||||||||||||||
| |||||||||||||||||
operation
(op )
| enum | 1 | ![]() ![]() ![]() ![]() | ||||||||||||||
| |||||||||||||||||
output
(o )
| float3 | 1.0, 0.0, 0.0 | ![]() ![]() | ||||||||||||||
| |||||||||||||||||
| |||||||||||||||||
|