ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Finding an intersection of two lines and parenting it

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
John Burgess
Finding an intersection of two lines and parenting it
on Jun 3, 2020 at 11:11:06 am

Hi, I am attempting to create a Lissajous curve table like the example driven by expressions.
By rotating a point at different speeds around a circle and tracing the x and y position from each it will generate different curves.



What I am struggling with is finding the the intersection of the x and y guides in red to then parent a shape layer to and use something like trails to draw them https://aescripts.com/trails/

I have created the below by parenting the x and y guides to the radius of each circle that has a rotation applied and then offsetting it by the rotation speed so they don't rotate.



Doing this removes the ability to easily access the x or y position of the guides as they are being driven by rotation which makes me question if this is the best method?

Thanks.

thisComp.layer("radius").transform.rotation*-1

thisComp.layer("radius").transform.rotation*-1.5-90


Return to posts index

Robert Müller
Re: Finding an intersection of two lines and parenting it
on Jun 3, 2020 at 1:32:18 pm

Hi,
this should work just fine, you need to access the global position of your guides. I made a setup parenting a small white circle on an outlined one, driven by the rotation:

xC=thisComp.layer("x1c"); //small white circle 1; For the X value
yC=thisComp.layer("y1c"); //small white circle 2; For the Y value
x=xC.toComp(xC.anchorPoint)[0]; //getting the global X value
y=yC.toComp(yC.anchorPoint)[1]; //getting the global Y value
[x,y]


I added this expression to the position of a null which then I can trace using Write-on or the plugin you linked.


Return to posts index

John Burgess
Re: Finding an intersection of two lines and parenting it
on Jun 3, 2020 at 3:53:45 pm

Hi Robert

This worked perfectly, thank you so much.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]