tirsdag den 14. juni 2016

New Camera Orientation expression

//Put Expression in Orintation

L = thisComp.layer("Camera 1"); 
u = fromWorldVec(L.toWorldVec([1,0,0])); 
v = fromWorldVec(L.toWorldVec([0,1,0])); 
w = normalize(fromWorldVec(L.toWorldVec([0,0,1])));

sinb = clamp(w[0],-1,1);
b = Math.asin(sinb);
cosb = Math.cos(b); 
if (Math.abs(cosb) > .0005){
 c = -Math.atan2(v[0],u[0]); 
 a = -Math.atan2(w[1],w[2]); 
}else{
 a = (sinb < 0 ? -1 : 1)*Math.atan2(u[1],v[1]); c = 0; 
}
[radiansToDegrees(a),radiansToDegrees(b),radiansToDegrees(c)]


// by on creativecow Sep 8, 2012 at 2:54:19 am
AE POSTWORK blog is virtually just a notepad, where I put all the AE expressions up I finde and use, its so I can easily get to them wherever I am and no matter what computer I sit at. I do not write my own expressions, so all expressions on the page is downloaded from the web,or modify versions i found. and tutorials etc.. I will try to credit those who have made expressions if I can.

Now, with tips and tricks for AE & C4D.
No more forgetting the little tricks and tips I found on my road with After Effects, etc.

Sebabba