ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Controller to orbit objects around a null

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mike Foran
Controller to orbit objects around a null
on Jul 14, 2014 at 10:45:19 pm

Hello, 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


Return to posts index

Dave LaRonde
Re: Controller to orbit objects around a null
on Jul 14, 2014 at 11:01:04 pm

I can't get to the project, but if there is an expression controlling this, you're probably missing the necessary z-axis values.

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index

Mike Foran
Re: Controller to orbit objects around a null
on Jul 14, 2014 at 11:27:29 pm

Here, 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


Return to posts index


Cassius Marques
Re: Controller to orbit objects around a null
on Jul 15, 2014 at 1:31:35 pm

Hey, 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.


Return to posts index

Michael Szalapski
Re: Controller to orbit objects around a null
on Jul 15, 2014 at 5:02:19 pm

Is 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.


Return to posts index

Mike Foran
Re: Controller to orbit objects around a null
on Jul 15, 2014 at 8:34:45 pm

Yes, I would like to rotate the orbiting objects independently. If I parent them to a null they rotate with the null.


Return to posts index


Michael Szalapski
Re: Controller to orbit objects around a null
on Jul 15, 2014 at 8:43:11 pm

I 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.


Return to posts index

Mike Foran
Re: Controller to orbit objects around a null
on Jul 16, 2014 at 4:16:28 am

I 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?


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]