Groups > Multimedia > Adobe After Effects expressions > Re: Changing Hue based on distance to camera




Changing Hue based on distance to camera

Changing Hue based on distance to camera
Sat, 20 Oct 2007 11:11:46 -070
&tHow can an expression adjust the hue value on Hue/Saturation effect based
on the distance to camera?

I understand the simple logic of "if layer distance to camera is > x,
use hue value 'n', else use hue value 'm'".

The expression syntax is just something I can't wrap my mind around.

Basic one color change
 <http://photobucket.com>

more complex two color change
Post Reply
Re: Changing Hue based on distance to camera
Sat, 20 Oct 2007 11:37:33 -070
In general, when you want to vary some parameter based on the distance from the
camera, you can set it up like this:

startVal = 0;
endVal = 100;
startDist = 50;
endDist = 1500;

C = thisComp.activeCamera;
dist = length(toWorld(anchorPoint),C.toWorld([0,0,0]));
linear(dist,startDist,endDist,startVal,endVal)

Where startVal and endVal define the range of values for the parameter (these
can be arrays, if necessary) and startDist and endDist define the range of
distances from the camera over which to apply the value range.

Post Reply
Re: Changing Hue based on distance to camera
Sat, 20 Oct 2007 12:46:12 -070
Ah - yes, it looks very similar to the 'fade opacity according to camera
distance' expression.

Post Reply
Re: Changing Hue based on distance to camera
Sat, 20 Oct 2007 12:54:59 -070
One way would be to apply a slider to your moving layer, and then apply this
part of the expression to the slider:

C = thisComp.activeCamera;
dist = length(toWorld(anchorPoint),C.toWorld([0,0,0]));

Post Reply
Re: Changing Hue based on distance to camera
Sat, 20 Oct 2007 12:59:59 -070
Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact