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: 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


Max PalmerRe: Expression to make a boat "ride" on top of generated waves?
by on May 11, 2012 at 3:49:01 pm

This is how I have it. All I did was change the target, and sample variables.

target = transform.rotation; targetWorldPos = target.toWorld(target.anchorPoint); sample = thisComp.layer("Waves"); offset = -10; for (i = 0; i < height; i++){ if (sample.sampleImage([clamp(targetWorldPos[0]+offset,0,thisComp.width), i], [0.5, 0.5], true)[3] > 0){ top = [0,i]; break; } else { top = [0,thisComp.height]; } } newWorldPos = target.fromWorld(target.toWorld(top)); offsetPos = [target.position[0]+offset,newWorldPos[1]]; for (i = 0; i < height; i++){ if (sample.sampleImage([clamp(targetWorldPos[0],0,thisComp.width), i], [0.5, 0.5], true)[3] > 0){ top = [0,i]; break; } else { top = [0,thisComp.height]; } } targetWorldPos = target.fromWorld(target.toWorld(top)); boatPos = [target.position[0],targetWorldPos[1]]; radians = Math.atan2(boatPos[1] - offsetPos[1],boatPos[0] - offsetPos[0]); radiansToDegrees(radians);


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]