PDA

View Full Version : Projecting 3D to 2Dcomp


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

Mylenium
10-02-2010, 09:01 AM
http://www.motionscript.com/mastering-expressions/lst-lens-flare.html

Mylenium

Janman
10-02-2010, 01: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]));
radius=269;L1size=900/2;x=radius*(Math.cos(ang));y=radius*(Math.sin(ang));
L1.toComp([L1size-x,L1size-y,0])

CGTalk Moderation
10-02-2010, 01:15 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.