Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US :: FAQ
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE AFTER EFFECTS:HomeForumBasicsExpressionsTutorialsPodcastsAE TechniquesCreative Cloud DebateFAQ

Re: Color changes on velocity

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Share on Facebook
Respond to this post   •   Return to posts index   •   Read entire thread


Darby EdelenRe: Color changes on velocity
by on May 28, 2012 at 11:20:21 pm

[Alain Lores] "
factor =5;
Math.abs(thisComp.layer("G").position.velocity[0])/factor;"


This is only sampling the X component of the velocity of your layer. Is that what you're after? You probably noticed that velocity has 2 or 3 components, these correspond to the rate of change on the X and Y (and Z on a 3D layer) axes. If you want to work with a single value, and you don't want to split the velocity into separate axes, then you probably want to use the "speed" property:


factor = 5;
thisComp.layer("G").position.speed/factor;


The Math.abs() function is not necessary for the position speed.


[Alain Lores] "1. The object that samples the colors to the left over shoots in height sampling black color. This object moves higher in height the faster the dot moves. How can i clamp the vales so that the object doesn't go past a certain height value?"

There are a couple of ways to accomplish this. One would be to use the Math.min() function:


max = 500;
factor = 5;
s = thisComp.layer("G").position.speed/factor;
Math.min(max, s);


Math.min() will return the smaller of the two values passed to it, so whenever "s" is greater than "max" it will return "max" effectively clamping the highest value returned to "max."


[Alain Lores] "2. Notice how the colors on the band of particles do not fade. Instead it's solid from one color to the next. This is the result of the object moving way too quickly from fast to slow. Is there a way to control the speed in which the object moves? For example, how can the values be "smoothed" so that as the object samples the color it's slow enough to gradient correctly on the band of particles."

There is a smooth() function you could use that may help in this case. You'll want to smooth() the position property of the sampler, but it may be more complicated than that depending on how you've set up the expressions.

Darby Edelen


Posts IndexRead Thread
Reply   Like  
Share on Facebook


Current Message Thread:




LOGIN TO REPLY



FORUMSTUTORIALSFEATURESVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2014 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]