PDA

View Full Version : Field orientation "driven" by (animation)path?


bravmm
03-19-2007, 04:36 PM
Hi all,

A quick question about fields. Say I have a (XZ)grid emitting a particle stream (Y), and this grid has animation on it moving it through (XZ) space. I want a vortex on these particles, but have the orientation of the "controling" vortex axis (X) be "linked to the (Y) orientation of the animated grid. Think of a airplane wingtip condensation trail.

Or said otherwise, can the axis of the vortex influence be other than world, and be linked to something that has (path) animation??

I tried several things but it seems with the "basic" setups it seems stuck to world axis. Or is this something that needs a MEL solution??

rob

AndersEgleus
03-19-2007, 05:06 PM
You can either use a Volume Axis field, which respects local transformation (and is also easier to visualize i.m.o.).

Or you can do the following: In hypershade, graph the vortex field and create a vectorProduct node. Set the vector product's operation to Vector Matrix Product, set input1 to (1.0, 0.0, 0.0) and turn on Normalize. Connect the vortex field's worldMatrix attribute to the vectorProduct's matrix attribute and connect back from the vectorProduct's output attribute to the vortexField's axis attribute. Now you can animate the vortexField any way you want and in any hierarchy and have the axis point in its local x-direction (in world space). If you want it to point in the y- or z-direction, just set input1 to (0.0, 1.0, 0.0) or (0.0, 0.0, 1.0) respectively.

This is quite a useful trick for converting a vector from any space into world space. If instead you'd want to convert a direction from world space to local space, just connect the worldInverseMatrix attribute of the dag-node to the matrix attribute of the vectorProduct. But that wouldn't be very useful in this case.

I think the reason why the vortexField's axis attribute is always in world space is because it can be controlled per particle if particles are the source of the field which is pretty nice i.m.o.

bravmm
03-20-2007, 11:31 AM
Thanks for the reply!
It all makes more sence now. Will look into the VectorProduct nodes as well, every extra "trick" will help :)

cheers,

rob

CGTalk Moderation
03-20-2007, 11:31 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.