ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Camera Auto Orient Y only

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
bart stevens
Camera Auto Orient Y only
on Jan 29, 2009 at 12:49:58 am

I'm trying to build a "carosoule" type animation, where a null is parent to multiple (16x9) images that surround it. I want to be able to rotate the null on it's y axis and zoom into the different images. I want the images to maintain their y axis and always face the camera.
I get the effect I want when I turn on auto-orient towards camera, but I dont't want the twisting/distortion of the images when I move the camera up or down on the Y axis.
I've tried using the Dab Ebbert's script, but I must be doing something wrong, because I still get distortion. And I haven't got the script working when the layers are animated by the controlling null vs. animating the camera.
Hopefully I've explained my challenge effectively.
Any help would be greatly appreciated


Return to posts index

Dan Ebberts
Re: Camera Auto Orient Y only
on Jan 29, 2009 at 5:28:46 am

I'm confused. Do you want the layers to always be oriented towards the camera, or just on the y axis?

Dan



Return to posts index

bart stevens
Re: Camera Auto Orient Y only
on Jan 29, 2009 at 4:02:07 pm

Thanks for the response Dan. I'll try and be more clear.
I want the layers to be orientated towards the camera but only on the y axis.
If I do all my animation with the camera, your script works perfect.
But when I have the image layers parented to a null and do my Y axis rotation animation with the null, the image layers don't keep their orientation towards the camera.
I can make it work with animating the camera, but would like to use the null if possible.
Thanks again,
Bart



Return to posts index


Dan Ebberts
Re: Camera Auto Orient Y only
on Jan 29, 2009 at 4:36:14 pm

It looks like I didn't set that up to account for parenting. Try this:

delta = fromWorldVec(toWorld(anchorPoint) - thisComp.activeCamera.toWorld([0,0,0]));
radiansToDegrees(Math.atan2(delta[0],delta[2]))


Dan



Return to posts index

bart stevens
Re: Camera Auto Orient Y only
on Jan 29, 2009 at 5:56:18 pm

Thanks Dan
The "from" vs. "to" in World space did the the trick.
Your website is a great inspiration, keep up the good work.
Thanks agian
-B



Return to posts index

Albert Kowalski
Re: Camera Auto Orient Y only
on Nov 2, 2017 at 11:33:05 am

Hey guys! I want to re-open this case ☺

I am making very similar thing. I control my image layer with my null layer. I rotate null layer on Y axis and make it parent to image layer. I added the script to Y Rotation of image layer, but as you can see my image is still distort. What am I doing wrong? Thanks!

Here's how it looks like: https://www.dropbox.com/s/1ppblmnlp6cilol/image.png?dl=0


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]