Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions intersect and sampleimage??

  • intersect and sampleimage??

    Posted by Maurice Jansen on January 10, 2010 at 4:39 pm

    hi there all.

    i’m trying to raise my skills with expressions.
    my goal was to draw a line on a layer where a other layer intersect’s
    with the color’s of that layer.

    a too high goal for a expression roocky like me 😉

    so i first tried to simplify my goal by making my layer that has to be sampled just rotate in Y and make a different solidlayer(the dots) change color and place it self on the place where the 2 intersect. (i guess the picture explain my goal a bit more)

    the sampling is going well but the placement goes wrong.
    it never crosses the middle of the layer and foldback!

    it’s a bit hard for me to explain my goals i hope you understand what i mean.

    is this the way to go for my final goal see begin post or am i thinking to difficult

    grt
    Maurice

    for the color of the fill effect
    ---------
    target=thisComp.layer("tobesampled2.jpg");
    angletarget=thisComp.layer("tobesampled2.jpg").transform.yRotation;
    angletargetRAD=degreesToRadians(angletarget);
    distancetarget=10;
    x=Math.sin(angletargetRAD)*distancetarget;
    a=distancetarget*distancetarget;
    b=x*x;
    z=Math.sqrt(a+b);
    XsamplePos=target.width/2-z;
    target.sampleImage([XsamplePos, 300], [0.5, 0.5])

    for the position of the layer
    ---------
    target=thisComp.layer("tobesampled2.jpg");
    angletarget=thisComp.layer("tobesampled2.jpg").transform.yRotation+90;
    angletargetRAD=degreesToRadians(hoeklaag);
    distancetarget=50;
    x=Math.tan(angletargetRAD)*distancetarget;
    a=distancetarget*distancetarget;
    b=x*x;
    z=Math.sqrt(a+b);
    XsamplePos=(target.width/2-z);
    Xpos=XsamplePos;
    Ypos=index;
    [Xpos,Ypos,50]

    People saying they don’t make mistake’s often make nothing at all!

    Maurice Jansen replied 16 years, 3 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy