Activity › Forums › Adobe After Effects › Controller to orbit objects around a null
-
Controller to orbit objects around a null
Posted by Mike Foran on July 14, 2014 at 10:45 pmHello, I am trying to build a controller that will allow me to control the orbit of several objects around a null point. I have successfully set it up to work in 2D space, but I am trying to convert it to 3D space and have become stuck.
My project file is here: https://dl.dropboxusercontent.com/u/1114555/Orbit%20Around%20Null.v01.aep
As you can see, the controller sets the radius and rotation, and the objects position themselves. The 2D one is fairly simple and works well. But the 3D one fails on the Z axis rotation. X and Y appear to work fine.
I would appreciate any help the group could give. Thanks.
-Mike
Mike Foran replied 11 years, 10 months ago 3 Members · 6 Replies -
6 Replies
-
Mike Foran
July 14, 2014 at 11:27 pmHere, perhaps this will help. The controller has a slider for a ‘radius’ value, a slider for the number of items in the orbit, and separate angle controllers for x, y, and z axes. Each object in the orbit has this expression in the Position field:
radius = thisComp.layer(“Controller”).effect(“Radius”)(“Slider”);
xangle = degreesToRadians(thisComp.layer(“Controller”).effect(“Rotation x”)(“Angle”));
yangle = degreesToRadians(thisComp.layer(“Controller”).effect(“Rotation y”)(“Angle”));
zangle = degreesToRadians(thisComp.layer(“Controller”).effect(“Rotation z”)(“Angle”));offset = degreesToRadians(index * (360/thisComp.layer(“Controller”).effect(“Number of Items”)(“Slider”)))
x = thisComp.layer(“Controller”).transform.position[0] – (radius* Math.cos(yangle – offset));
y = thisComp.layer(“Controller”).transform.position[1] – (radius* Math.sin(xangle – offset));
z = thisComp.layer(“Controller”).transform.position[2] + (radius* Math.sin(zangle – offset));[x,y,z];
-Mike
-
Cassius Marques
July 15, 2014 at 1:31 pmHey, I have a very limited expression knowledge and even less math skills, but looking at that expressions I can see that, for a start, your Z calculations have a total disregard for your X and Y values.
This will never work until you find out a way to intertwine all 3 dimensions.
-
Michael Szalapski
July 15, 2014 at 5:02 pmIs there a reason you don’t just parent another null to the first one, parent your object to it, and then rotate the new null?
– The Great Szalam
(The ‘Great’ stands for ‘Not So Great, in fact, Extremely Humble’)No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.
-
Mike Foran
July 15, 2014 at 8:34 pmYes, I would like to rotate the orbiting objects independently. If I parent them to a null they rotate with the null.
-
Michael Szalapski
July 15, 2014 at 8:43 pmI don’t think you understand what I’m saying or I don’t understand what you’re asking for.
If you create one null per object you would like to rotate, they will rotate around the central point, but each one will be independent.– The Great Szalam
(The ‘Great’ stands for ‘Not So Great, in fact, Extremely Humble’)No trees were harmed in the creation of this message, but several thousand electrons were mildly inconvenienced.
-
Mike Foran
July 16, 2014 at 4:16 amI think perhaps a bit of both. I have several objectives in approaching the problem this way. One, as I discussed, is that I want to control each object independently while still maintaining the general orbit. Another is that I would like to have an expression and (ideally) a controller that would automatically space the objects on the circumference depending on how many objects I have in play. In this way, no matter how many objects i need to manipulate, the expressions can accommodate automatically (or semi-automatically in the way it is set up here). It would be easy enough to parent my objects to a null with a camera and have them auto-orient to the camera. I could still manipulate their rotation independently. But want to be able to control a variable number of objects without having to manually place them.
That being said I am not sure I quite get what you are describing. Would you mind posting a project file with the technique?
Reply to this Discussion! Login or Sign Up