Sunday 21 February 2016

bifrost accelrator direction (use object's transform)

We need to create a relationship between the emitter’s rotation
and its Acceleration Direction vector.To do this, we'll use a pointMatrixMult node.This node allows us to multiply a point by a matrix.Rename it "water_spray_redirect_MULT".First, we'll feed the emitter shape node's "worldMatrix" attributeinto this node's "In Matrix" attribute.The worldMatrix attribute represents the 4 x 4 transformation matrixof the emitter's translation and rotation in World Space.As the emitter moves along with the gun, this vector changes accordingly.Next, we need to multiply this vector by the emitter’s spray direction attribute,which is in its own local space.Remember that our starting direction vector in world space was -1, 0.577, 0.However, relative to the emitting cylinder object, it's simply spraying straight out the top.Thus, we'll set In Point to 0, 1, 0.We'll also need to turn on Vector Multiply to specify that we want a vector productrather than the scalar product.Now you can feed the output of this into the water_spray_emitter_GEOShape's"Bifrost Accelerator Direction" attribute.