PDA

View Full Version : Using the speed or velocity of an object to drive a channel

Dirk
11-30-2008, 02:57 AM
Using the speed or velocity of an object to drive a channel: how to do that?

Dirk
11-30-2008, 04:10 AM
For example, I want to drive the dissolve channel of an object with it's speed. I f speed is = 0, dissolve should be 100%. For relativity, I come up with

1+(-SPEEDW(SELF,t)*0.161)

where 1 is 100% Dissolve, and 0.161 is an arbitrary value to match the envelope to 0% Dissolve.

Feels somehow uncool to do this stuff in LW...

serge
11-30-2008, 10:31 AM
The following nodal setup with Dpont's Item Info node (which has a time input) should work.

See image. Instead of 'dissolve' I've used 'transparency'. This setup calculates the distance between the current item's position and the position at its previous frame. The time input of second Item Info node is set to -0.033 (which is about one frame in case of 30 frames/s). The gradient says the transparency is 100% (white) at a distance of 0, and 0% (black) at a distance of 1 meter.

I guess it's possible to use 'dissolve' instead of 'transparency', but you'd need a way to create an envelope from the nodal setup. You could use the same nodal setup as above, but use it in Nodal Displacement to drive for example the Y-channel of a single point. Then create a Null following this point with Dpont's Node Item Motion and then bake its Y motion, and copy paste it at the 'dissolve' channel.

Dirk
12-01-2008, 03:28 AM
Thanks - I really have to look into dpont's nodes.

I came up with this after some experiments:

1-(((SPEEDW(SELF,t)+SPEEDW(SELF,t-0.1)+SPEEDW(SELF,t+0.1))/3)*0.161)

This dampens the curve. I wanted to normalize the curve automaticly, but that's not possible afaik, since the whole speed curve has to be present before I know how to scale it.