PDA

View Full Version : Projecting 3D to 2Dcomp

 Janman09-30-2010, 02:00 PMI'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
Mylenium
10-02-2010, 08:01 AM
http://www.motionscript.com/mastering-expressions/lst-lens-flare.html

Mylenium

Janman
10-02-2010, 12:15 PM
Thanks !!!
I've should have know that everything can be solved with lensflares ;-)

Been staring at it too long, thanks for the new view !!
Changed the expression according to Dan's workflow and everything works now;

L1=thisComp.layer("Bol1");L2=thisComp.layer("Bow1");
p1=L1.transform.position; p2=L2.transform.position;
delta = sub(p1, p2); ang=(Math.atan2(delta[1], delta[0]));