ahh, vinhson bro! my name was j2murada back then. i randomly decided to check up on how my youtube homies back in 09 were doing. i see you're the only one that's video editing passion/fire never burnt out. glad you're doing well bro.
great. Thnx. Just a short question. I have a 3D element-eye and this has to follow a null. The eye has two radial rotation properties - up and down and left to right. How to approach this problem?
THANKS!!!! var toPt = thisComp.layer("Circle").transform.position; var fromPt = transform.position; function lookAtMe(fromPt, toPt){ d = toPt - fromPt //prevent divide-by-zero errors if (d[0] == 0){ A = (d[1]>0)? 90: -90; } else { //using my trigonometric super powers for good instead of evil A = radiansToDegrees (Math.atan(d[1]/d[0])) } //shorthand for if the X difference is negative, add 180° return 90 + ((d[0]>0)?A: 180+A); } lookAtMe (fromPt, toPt);
I don´t know why this did not work , it kept giving me an error, nonetheless I found this code which works great: p1 = thisComp.layer("Start").transform.position; p2 = thisComp.layer("End").transform.position; v = p2 - p1; radiansToDegrees(Math.atan2(v[1], v[0]));
i enjoy coming back to your tutorials for quick and clear refreshers on 'how to'. years late, but thanks, as always
ahh, vinhson bro! my name was j2murada back then. i randomly decided to check up on how my youtube homies back in 09 were doing. i see you're the only one that's video editing passion/fire never burnt out. glad you're doing well bro.
And he is back!
Cranking out 2 videos a month :D
Awesome! Thank you for the great tutorial! Any insight on how to make this work with 3D layers enabled?
great tut thanks! I have a question about changing colors! If the null close to object and the color will change! how can coiding this?
function lookAtme(fromPt, toPt){
d = toPt - fromPt
if (d[0] == 0){
A = (d[1]>0)? 90: -90;
} else {
A = radiansToDegrees(Math.atan(d[1]/d[0]))
}
return 90 + ((d[0]>0)?A: 180+A);
}
var toPt = thisComp.layer("the layer we want to look at").transform.position;
var fromPt = transform.position;
lookAtme(fromPt, toPt)
thanks!
Thank you so much 🙏
Can this "lookAtMe" expressions acrivated on proximity, like this expressions will active if the shape near to the effector?
Drop a comment below for the RUclips algorithm 🙏🏻
expressions man in youtube ! 😍
Haha thanks for the support!
Please write down in the description the exact expression. I cant make it work. thanks in advanced
great. Thnx. Just a short question. I have a 3D element-eye and this has to follow a null. The eye has two radial rotation properties - up and down and left to right. How to approach this problem?
Beautiful Code!
I guess the calculation if we want to add more than one code is a bit deeper in mathematics.
Any idea how to do it?
Is there a solution for when the lookAt Null and the rotation layer are parented to other layers?
Wow
Thanks for the support Mahi!
A comment for the RUclips algorithm
Bless your soul ❤️
THANKS!!!!
var toPt = thisComp.layer("Circle").transform.position;
var fromPt = transform.position;
function lookAtMe(fromPt, toPt){
d = toPt - fromPt
//prevent divide-by-zero errors
if (d[0] == 0){
A = (d[1]>0)? 90: -90;
} else {
//using my trigonometric super powers for good instead of evil
A = radiansToDegrees (Math.atan(d[1]/d[0]))
}
//shorthand for if the X difference is negative, add 180°
return 90 + ((d[0]>0)?A: 180+A);
}
lookAtMe (fromPt, toPt);
I don´t know why this did not work , it kept giving me an error, nonetheless I found this code which works great:
p1 = thisComp.layer("Start").transform.position;
p2 = thisComp.layer("End").transform.position;
v = p2 - p1;
radiansToDegrees(Math.atan2(v[1], v[0]));