Janman

09-30-2010, 03:00 PM

I've got 2 circular elements ( A and B ) in 3D-space,

the circles are moving and the camera is moving too.

I want to connect the radius of the 2 circles with a "beam",

To place the start of the beam on circle A I use;

p1=thisComp.layer("A").transform.position;

p2=thisComp.layer("B").transform.position;

delta = sub(p1, p2);

angle=(Math.atan2(delta[1], delta[0]));

radius=250;

x=radius*(Math.cos(angle));y=radius*(Math.sin(angle));

CO1=sub(p1,[x,y]);

toComp(CO1)

If i use this data on a 3D-layer it follows the radius correctly but,

problem is that i can't seem to project the coordinate to the screen

to get the beam's 2D coordinate.

somebody has a clue ?

thanks,

Jan

http://www.visueel.net/images/beam.jpg

the circles are moving and the camera is moving too.

I want to connect the radius of the 2 circles with a "beam",

To place the start of the beam on circle A I use;

p1=thisComp.layer("A").transform.position;

p2=thisComp.layer("B").transform.position;

delta = sub(p1, p2);

angle=(Math.atan2(delta[1], delta[0]));

radius=250;

x=radius*(Math.cos(angle));y=radius*(Math.sin(angle));

CO1=sub(p1,[x,y]);

toComp(CO1)

If i use this data on a 3D-layer it follows the radius correctly but,

problem is that i can't seem to project the coordinate to the screen

to get the beam's 2D coordinate.

somebody has a clue ?

thanks,

Jan

http://www.visueel.net/images/beam.jpg