I am trying to make an expression to achieve a certain effect.
Imagine a comp 720x480, a solid 3D layer 160x600 and a camera.
I move the anchor point of the solid to the bottom of the solid. Now I can rotate the X axis and make it lay flat from the bottom.
I want to put a bunch of these little solds in my comp and have them automatically rotate from flat to 90 degrees straight up as I move the camera through a 3D comp. So the solids are distributed in z-space. I also want them to stay up for a certain amount of thime as the camera passes through, then rotate back down as if the camera has pushed them down as it moved through it.
The entire rotation sequence, if thought of as key frames might be like this. While camera is far, x rotate -90. As camera approaches, rotate up to 0. Hold zero for a short/adjustable amount of time, then as camera passes the layer's z-position, rotate back down to 90.
This is kind of like a popup book. With the popups happening as the camera approaches.
My first thought as to adapt the y-orient expression on Dan's site. So I have this code that is linked to two slider controls..
Code: Select all
delta = toWorld(anchorPoint) - (thisComp.activeCamera.toWorld((thisComp.layer("Camera 1").position)*thisComp.layer("Adjustment Layer 1").effect("Distance")("Slider")));
radiansToDegrees(Math.atan2(delta[1],delta[2]))-thisComp.layer("Adjustment Layer 1").effect("Offset")("Slider")
I'm wondering if anyone has made this effect before, or knows how I could adapt the expression?
Thanks