Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: HomeForumBasicsExpressionsTutorialsPodcastsMotion GraphicsTrainingCinema 4DFAQ

Projecting 3D to 2D with toComp()

Cow Forums : Adobe After Effects Expressions
VIEW POSTS   •   ADD A NEW POST   •   SEARCH   •   CHANGE FORUM
Respond to this post   •   Return to posts index   •   Read entire thread


Projecting 3D to 2D with toComp()
by Darby Edelen on Sep 1, 2009 at 7:25:29 am

I'm facing an issue with a project I'm working on in which I'm trying to draw a beam using the Generate > Beam effect in 3D space. The expressions I'm using for start and end point and thickness are all working well, except when the world coordinates they point to end up behind my camera. Here are the expressions I'm using (the 'ending' expressions are the same only they refer to a different layer):

Starting Point:
l = effect("Source")("Layer");
l.toComp(l.anchorPoint);

Starting Thickness:
c = thisComp.activeCamera;
l = effect("Source")("Layer");
z = c.zoom;
p1 = c.toWorld([0,0,0]);
p2 = l.toWorld(l.anchorPoint);
d = length(p1, p2);
value * z/d;


From what I know about projecting 3D coordinates into 2D space this is to be expected, but I wonder if anyone might have some insight into how I can effectively find the intersection point of the ray/beam I'm drawing and an infinite plane some short distance in front of my camera so that I can then use THAT world coordinate as my end point and prevent the world coordinate from passing behind the camera?

Please help!

Darby Edelen


Respond to this post   •   Return to posts index   •   Read entire thread


Current Message Thread:




Note: If you are a registered user please click here to login before posting.

Your post will not be accepted if your name and email address are not registered in our database. Click here if you do not have an account.

Name
E-Mail Address
Subject
E-Mail me when someone responds
Just This Message   Entire Thread   None  

Message:



Note: The following are HTML characters and may cause parts of your post to disappear if not used correctly: < > &
To include any portion of the post in your response, highlight the desired text and hit the "Q" key. Read more...



Please post Expressions Code in the box below:


Add your message signature


 


Note: By clicking "Post Direct" button above, you are agreeing to the Creative Cow's Code of Conduct.



FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]