-
Get 3D position given the 3D angle and distance
I’m looking to position some layers in a sphere formation. I realize I could do this by parenting each layer to a separate Null Object, and then rotating the Nulls to make the layers orbit around to different positions on the sphere. But for the project I’m making, I would really prefer to do this with an expression if possible.
This expression (from Dan Ebberts, I believe) works well to position a layer in a 2D circle around a center point, when given a Distance and Angle value:
a = effect(“Angle Control”)(“Angle”);
d = effect(“Slider Control”)(“Slider”);
r = degreesToRadians(a-90);
x = d*Math.cos(r);
y = d*Math.sin(r);
value + [x,y]
So I’ve been trying to make a 3D version of this. Ideally, using a 3D Point Control to control the angle. Sorry, I’m not lazy, I’m just too dumb to figure this out. Thank you for your help.