Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: HomeForumBasicsExpressionsTutorialsPodcastsMotion GraphicsTrainingCinema 4DFAQ

Making objects change position while within range of a camera

Cow Forums : Adobe After Effects Expressions

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
Making objects change position while within range of a camera
by Twelvizm on Mar 23, 2007 at 1:04:20 pm

Think Pop-up targets.

I'm going for an expression that will make objects go from horizontal to vertical while within the visible area of an animated camera.

Any ideas?

Respond to this post   •   Return to posts index

Re: Making objects change position while within range of a camera
by wuzelwazel on Mar 23, 2007 at 5:33:30 pm

You could use an expression to convert the object's 3D coordinates to 2D screen (Comp) space and then rotate the layer based on how far it has traveled beyond a threshold value 'left' in this case:

left = 150; //The distance in pixels from the left side of the comp when the layer begins to rotate
right = thisComp.width - left; //The distance in pixels from the right side of the comp when the layer begins to rotate back
duration = 50; //The distance in pixels that the layer will need to travel beyond the threshold for the rotation to reach the 'end' angle
start = -90; //The angle to begin the rotation from
end = 0; //The angle to rotate to

angle = start;

x = thisLayer.toComp(anchorPoint)[0]; //Transform this layer's 3D Coords into its 2D coords and use the X value only

//If we've passed the 'left' side but haven't reached the 'right' side yet
if((x >= left)&&(x <= right)){
angle = ease(x, left, left + duration, start, end); //ease from the 'start' to 'end' angle as the x value increases from 'left' to 'left + duration'
}

if(x > right){
angle = ease(x, right, right + duration, end, start); //ease from the 'end' to 'start' angle as the x value increases from 'right' to 'right +duration'
}

angle; //return the angle


That should work!

Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]