Return-Path: Received: from mail-we0-f172.google.com ([74.125.82.172] verified) by media-motion.tv (CommuniGate Pro SMTP 4.2.10) with ESMTP-TLS id 5184036 for AE-List@media-motion.tv; Wed, 21 Aug 2013 21:17:26 +0200 Received: by mail-we0-f172.google.com with SMTP id t60so839032wes.3 for ; Wed, 21 Aug 2013 12:29:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=WZ4pScJesHQ8lgconT1KhhVHF2Fn4X4s28Hbtmidt+o=; b=K3j6vCAAI7jQZs0pbpONFqnI0egM1z4SRtO57FPjnLChBTHqdgbRPrHVaUTcGTd07R DG1nmK740oS3bRcng4KU0rYAakiqPCBdaqNrXkI0OKeaLZdk5TUyGXiC4+pXnae8MaXK djBXp2KFSLjJrcpSxNHvcEjJ6B8nAv2IAj3mrxe9ON7TdzF+JGzKlxrdxLmJ1YRStifN SoD+9XhadCqeXjp844xWO+Ja0Da8VhZRdEFuOxqtGrRJQzCppUD082w1FldJfhdJH/8O bCe8vHcZOnczHCEMB5wAclZB6WrsElc8kYYL1sRK/2k+o64fVYkHTHVUKDqfpugiS8Zl 5EUw== X-Gm-Message-State: ALoCoQmCE7El0yrOPVek4/7mAomvk9qgRpcx7i8sMez5/b050u0p4BJ6MX0Kq/mwIVnuCs4rbNo2 MIME-Version: 1.0 X-Received: by 10.180.80.71 with SMTP id p7mr6609572wix.48.1377113376126; Wed, 21 Aug 2013 12:29:36 -0700 (PDT) Received: by 10.194.234.36 with HTTP; Wed, 21 Aug 2013 12:29:36 -0700 (PDT) X-Originating-IP: [108.21.101.229] In-Reply-To: References: Date: Wed, 21 Aug 2013 15:29:36 -0400 Message-ID: Subject: Re: [AE] Fading a light beyond a certain angle From: Alex Czetwertynski To: After Effects Mail List Content-Type: multipart/alternative; boundary=f46d0442887c99893604e47a31f5 --f46d0442887c99893604e47a31f5 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Thanks! On Wed, Aug 21, 2013 at 2:40 PM, Darby Edelen wrote: > And I didn't double check my expression before sending it out. The > variable names are mismatched. Here it is fixed: > > range =3D 90; > d =3D Math.cos(degreesToRadians(range / 2)); > > c =3D thisComp.layer("Camera 1"); > cv =3D c.toWorldVec([0,0,-1]); > v =3D toWorldVec([0,0,1]); > facing =3D dot(v,cv); > linear(facing, d, 1, 0, value); > > Sorry for the expression spam ;) > > > On Wed, Aug 21, 2013 at 11:32 AM, Darby Edelen wrote: > >> Reading again I think we're talking about a spotlight rotating. Sorry fo= r >> the misunderstanding on my part. I'd try something like this in that cas= e: >> >> range =3D 90; >> d =3D Math.cos(degreesToRadians(falloff / 2)); >> c =3D thisComp.layer("Camera 1"); >> cv =3D c.toWorldVec([0,0,-1]); >> v =3D toWorldVec([0,0,1]); >> facing =3D dot(v,cv); >> linear(facing, d, 1, 0, value); >> >> Here the 'range' defines the section out of the 360=B0 rotation that the >> spotlight is on. The spotlight will be brightest when pointing in the >> opposite direction the camera is pointing and fade down as it approaches >> the edge of its 'range.' >> >> One thing to note is that this expression works as the light rotates >> around either the x or y-axis. So rotating the light on the x-axis will >> have a similar effect as rotation on the y-axis. >> >> On Aug 21, 2013 10:49 AM, "Darby Edelen" wrote: >> >>> I'm not sure that I've understood the goal but here's an expression tha= t >>> will fade the light as it leaves a specified field of view: >>> >>> inner =3D 20; >>> outer =3D 50; >>> if(inner < outer){ >>> c =3D thisComp.layer("Camera 1"); >>> cv =3D [0,0,1]; >>> p =3D normalize(c.fromWorld(toWorld([0,0,0]))); >>> iBound =3D Math.cos(degreesToRadians(inner / 2)); >>> oBound =3D Math.cos(degreesToRadians(outer / 2)); >>> angle =3D dot(p,cv); >>> linear(angle, iBound, oBound, 0, value); >>> } >>> else value; >>> >>> So in the above example the light would be at 'value' intensity when >>> it's within a 20=B0 range of the view center and 0% intensity when it's >>> outside of 50=B0 from view center. If you want the light to turn off qu= ickly >>> choose an inner value that is close to the outer value. If you want it= to >>> fade gradually choose values that are farther apart. >>> >>> I've only included rudimentary error prevention so if inner and outer >>> are the same value or inner is larger than outer the expression will >>> default to the light's keyframed intensity. >>> >>> >>> On Tue, Aug 20, 2013 at 5:58 PM, Alex Czetwertynski < >>> alex@disciplefilms.com> wrote: >>> >>>> Hello >>>> >>>> I'm trying to figure out an expression to control the brightness of a >>>> rotating light. >>>> My light is turning on itself, on the Y axis. Everytime it passes 90 >>>> degrees, rotating away from the camera, I'd like to reduce its intensi= ty, >>>> and then bring it back when it is starting to enter the quadrant in wh= ich >>>> it will face the camera. >>>> >>>> If the camera was just rotating once, I'd use a linear expression that >>>> mapped 180 to 270 degrees and faded the light in between those two val= ues, >>>> but it is constantly looping=85 >>>> I thought I might be able to use Radians, but they, obviously, keep >>>> increasing with the degrees=85 >>>> >>>> Any suggestions? >>>> >>>> Thanks! >>>> Alex >>>> >>>> >>>> +---End of message---+ >>>> To unsubscribe send any message to >>>> >>> >>> > --f46d0442887c99893604e47a31f5 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable
Thanks!


On Wed, Aug 21, 2013 at 2:40 PM, Darby Edelen <dedelen@gm= ail.com> wrote:
And I didn't double che= ck my expression before sending it out. =A0The variable names are mismatche= d. =A0Here it is fixed:

range =3D 90;
d =3D Math.cos(degrees= ToRadians(range / 2));

c =3D thisComp.layer("Camera 1");
cv =3D c.toWorldVec([0,0,-1]= );
v =3D toWorldVec([0,0,1]);
facing =3D dot(v,cv);
linear(facing,= d, 1, 0, value);

Sorry for the expression spam ;)


On Wed, Aug 21, 2013 at 11:32 AM, Darby = Edelen <dedelen@gmail.com> wrote:
Reading again I think we're talking about a = spotlight rotating. Sorry for the misunderstanding on my part. I'd try = something like this in that case:

range =3D 90;
d =3D Math.cos(degreesToRadians(falloff / 2));
c =3D thisComp.layer("Camera 1");
cv =3D c.toWorldVec([0,0,-1]= );
v =3D toWorldVec([0,0,1]);
facing =3D dot(v,cv);
linear(facing,= d, 1, 0, value);

Here the 'range' defines the section out of= the 360=B0 rotation that the spotlight is on.=A0 The spotlight will be bri= ghtest when pointing in the opposite direction the camera is pointing and f= ade down as it approaches the edge of its 'range.'

One thing to note is that this expression works as the light rotates aro= und either the x or y-axis.=A0 So rotating the light on the x-axis will hav= e a similar effect as rotation on the y-axis.

On Aug 21, 2013 10:49 AM, "Darby Edelen" <dedelen@gmail.com> wrote:
I'm not sure that I've understood the goal bu= t here's an expression that will fade the light as it leaves a specifie= d field of view:

inner =3D 20;
outer =3D 50;
if(inner < out= er){
=A0=A0=A0 c =3D thisComp.layer("Camera 1");
=A0=A0=A0 cv =3D [= 0,0,1];
=A0=A0=A0 p =3D normalize(c.fromWorld(toWorld([0,0,0])));
=A0= =A0=A0 iBound =3D Math.cos(degreesToRadians(inner / 2));
=A0=A0=A0 oBoun= d =3D Math.cos(degreesToRadians(outer / 2));
=A0=A0=A0 angle =3D dot(p,cv);
=A0=A0=A0 linear(angle, iBound, oBound, 0= , value);
}
else value;

So in the above example the ligh= t would be at 'value' intensity when it's within a 20=B0 range = of the view center and 0% intensity when it's outside of 50=B0 from vie= w center. If you want the light to turn off quickly choose an inner value t= hat is=20 close to the outer value.=A0 If you want it to fade gradually choose=20 values that are farther apart.

I've only included rudimentary er= ror prevention so if inner and outer are the same value or inner is larger = than outer the expression will default to the light's keyframed intensi= ty.


On Tue,= Aug 20, 2013 at 5:58 PM, Alex Czetwertynski <alex@disciplefilms.com= > wrote:
Hello

I'm trying to figure out an expression to control the brightness of a r= otating light.
My light is turning on itself, on the Y axis. =A0Everytime it passes 90 deg= rees, rotating away from the camera, I'd like to reduce its intensity, = and then bring it back when it is starting to enter the quadrant in which i= t will face the camera.

If the camera was just rotating once, I'd use a linear expression that = mapped 180 to 270 degrees and faded the light in between those two values, = but it is constantly looping=85
I thought I might be able to use Radians, but they, obviously, keep increas= ing with the degrees=85

Any suggestions?

Thanks!
Alex


+---End of message---+
To unsubscribe send any message to <ae-list-off@media-motion.tv>



--f46d0442887c99893604e47a31f5--