3d Point Control toComp

Moderators: Disciple, zlovatt

Post Reply
petfactory
Posts: 3
Joined: December 3rd, 2011, 8:39 am

Hi,

Is it possible to get a 2d pos (toComp) from a 3d position supplied by a 3d Point Control effect ?

I have a null to which I have added a 3d Point Control effect. I wish to project this position on a 2d solid. I get it to work if I use a 3d null and position that in 3d using the 3d Point control and use layer.toComp(l.anchorPoint) for instance, but it would be nice to not have to clutter the comp with a lot of nulls. Feels like a bit of a bad workaround...

So what I would like to setup is a comp containing a camera, a null with a 3d pos effect and a 2d solid. Depending on the camera orientation and position & the 3d point control value, to project the 3d pos on the 2d solid (comp space). (without the use of 3d nulls in the scene)

Thankful for replies :)

Best Regards, Johan
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

Is this what you mean?

L = thisComp.layer("Null 1");
L.toComp(L.effect("3D Point Control")("3D Point"))

To get the z position correctly, it appears that the null has to be a 3D layer.

Dan
petfactory
Posts: 3
Joined: December 3rd, 2011, 8:39 am

Hi !

Thank you for your quick answer !
I have tried the setup that you suggested but it does not seem to work.

I have one layer called "LE" ( short for Layer Expression ) with a 3D Point Control effect applied.

To verify the 3d pos to comp pos I have another 2d solid with a circle effect applied to it. I am controlling the center ( x & y ) pos with the expression below.

LE = thisComp.layer("LE");
LE.toComp(LE.effect("3D Point Control")("3D Point"));

In the second setup I have linked the position of a 3d null ( named "LN" ) to the 3D Point property of the 3D Point Control expression of layer "LE".
So the 3d pos of the 3d null named "LN" is supplied by the 3D Point Control.
When I instead supply the "real" 3d position of the 3D null to the toComp function I get a result that I expect.

LN = thisComp.layer("LN");
LN.toComp(LN.anchorPoint);

The 3d positions are the same, but the results are different. Has the different results something to do in what coordinate space the 3d positions "lives in" ?

Would be really handy to use 3d pos without the need for 3d nulls.
Thank you, I am a big fan of your work by the way. It has helped me many times :)

Best Regards,

Johan
Dan Ebberts
Posts: 320
Joined: June 26th, 2004, 10:01 am
Location: Folsom, CA
Contact:

Is your layer with the circle comp-sized and centered in the comp? If not, I would think you'd have to do it this way:

LE = thisComp.layer("LE");
fromComp(LE.toComp(LE.effect("3D Point Control")("3D Point")));

And your LE layer is 3D, correct?

I just tried it and didn't have any issues with your first setup, so I don't know what's wrong.

Dan
petfactory
Posts: 3
Joined: December 3rd, 2011, 8:39 am

Hi,

Thank you for your reply. I finally got it to work.
One important step, that I had missed, was to set the position of the null layer that has the 3d point control effect to [0,0,0].
If done this works fine:

LE = thisComp.layer("LE");
LE.toComp(LE.effect("3D Point Control")("3D Point"));

My initial idea was to use the 3d point control just to generate a 3d pos in world space, but it seems that 3d pos effect is relative to the coordinate space of the layer the effect is applied to ? is that right ?
I tried to use toWorld to get a world space position, and project that toComp but got strange results. I am trying to wrap my head around how to work with the coordinate space in afx and have obviously more reading to do, but thank you for assistance.
Any suggestions where to read up on this subject, tips and ideas are more then welcome !

Thank you once again, and merry christmas to all !
Regards, Johan
Post Reply