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

Re: Expression to make a boat "ride" on top of generated waves?

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


Dan FredleyRe: Expression to make a boat "ride" on top of generated waves?
by on May 11, 2012 at 12:46:42 am

change the sampleLayer to your water layer and then try applying the following to the boat position.

L = thisLayer;
targetPosition = L.toWorld(L.anchorPoint);
sampleLayer = thisComp.layer(thisComp.numLayers);
for (i=0; i<thisComp.height;i++) {
alphaCheck = sampleLayer.sampleImage(sampleLayer.fromWorld([targetPosition[0],i]), radius = [.5,.5]);
if (alphaCheck[3]&lt;1) {
continue;
} else {
alphaPosition = [0,i];
break;
}
}
newWorldPos = L.fromWorld(L.toWorld(alphaPosition));
[value[0],newWorldPos[1]]


Dan Fredley


Posts IndexRead Thread
Reply   Like  
Share on Facebook


Current Message Thread:




LOGIN TO REPLY



FORUMSTUTORIALSMAGAZINESTOCKYARDVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

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

[Top]