Return-Path: Received: from mail-vc0-f172.google.com ([209.85.220.172] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP-TLS id 5013254 for AE-List@media-motion.tv; Sun, 24 Mar 2013 23:05:19 +0100 Received: by mail-vc0-f172.google.com with SMTP id hr11so4359815vcb.17 for ; Sun, 24 Mar 2013 15:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=w5J7ULcyYUyTyG6OT0yN1/7N5a1AS4RJIFRXMAPWPeQ=; b=T3ZsEY6y4A6kQjzCzHKFOi448J7Ubpehpu9OzL5XLANEcWJ0NCRgh6Xc9boCvxtlEF tAmwrzTzFr7D6P89aLpIQqP+8QyqHCfr5Zvjwie0fkyijYMHpKTSIHE08135SqSVJ+Bj SwQTPfQVXgBatc4gZWlsNHYodJM8MtjB17JYJAcrAnEyQId++QscSSoEfml5cFa6lEps PTTUfhpFspJOBRdCXiOx+EGrC8pOgs5fR3799J3lRxaABgAhFp31fXosmbBO6lYvqHmU vORzr/b2JL+rR2qUpnxKIByr9AQlqN27Rl6ZuIIPHtAbZMelzL2PIq0OT/S43FYwaK3T 8BMw== MIME-Version: 1.0 X-Received: by 10.220.124.196 with SMTP id v4mr6886466vcr.44.1364163161073; Sun, 24 Mar 2013 15:12:41 -0700 (PDT) Received: by 10.52.92.169 with HTTP; Sun, 24 Mar 2013 15:12:40 -0700 (PDT) In-Reply-To: References: Date: Sun, 24 Mar 2013 15:12:40 -0700 Message-ID: Subject: Re: [AE] Rotation Expression Problem From: Darby Edelen To: After Effects Mail List , "mylenium@mylenium.de" Content-Type: multipart/alternative; boundary=047d7b343708a1b01b04d8b2fc1c --047d7b343708a1b01b04d8b2fc1c Content-Type: text/plain; charset=ISO-8859-1 Indeed, you can most likely use the vector functions to do this and it will depend some on your set up. That said, in 2D this seems to work pretty well on the "guy" layer's rotation: floor = thisComp.layer("Floor"); ladder = thisComp.layer("Ladder"); v = floor.toWorldVec([1,0,0]); r = ladder.fromWorldVec(v); radiansToDegrees(Math.atan2(r[1],r[0])) + value; Including the "+ value" at the end should allow you to offset from a direct perpendicular orientation to the floor by changing the rotation value itself. In 3D things get a little more complicated because you really have 2 axes to consider. I modified the above and got close by applying it to Orientation but it's not a perfect solution, it may work in your case: floor = thisComp.layer("Floor"); ladder = thisComp.layer("Ladder"); v = floor.toWorldVec([1,0,0]); r = ladder.fromWorldVec(v); lookAt([0,0,0], r); Someone with some more vector math chops might have a better solution in 3D. --047d7b343708a1b01b04d8b2fc1c Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Indeed, you can most likely use the vector functions = to do this and it will depend some on your set up.=A0 That said, in 2D this= seems to work pretty well on the "guy" layer's rotation:
=
floor =3D thisComp.layer("Floor")= ;
ladder =3D thisComp.layer("Ladder");
v =3D floor.toWorldV= ec([1,0,0]);
r =3D ladder.fromWorldVec(v);
radiansToDegrees(Math.atan= 2(r[1],r[0])) + value;

Including the "+ value" at the end should allow you to = offset from a direct perpendicular orientation to the floor by changing the= rotation value itself.=A0 In 3D things get a little more complicated becau= se you really have 2 axes to consider.=A0 I modified the above and got clos= e by applying it to Orientation but it's not a perfect solution, it may= work in your case:

floor =3D thisComp.layer("Floor&qu= ot;);
ladder =3D thisComp.layer("Ladder");
v =3D floor.toWo= rldVec([1,0,0]);
r =3D ladder.fromWorldVec(v);
lookAt([0,0,0], r);

Someone with some more vector math chops might have a better solu= tion in 3D.
--047d7b343708a1b01b04d8b2fc1c--