ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Rotation / Beam Problem in a Solar System Animation

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Florian LiedtkeRotation / Beam Problem in a Solar System Animation
by on Nov 22, 2016 at 11:38:06 pm

Hello everybody!

Long time visitor here, now I have a question I cannot find the answer to. I might not know the correct search terms, mind you. So if this topic, which I searched for, does already exist, I kindly ask you to forgive me and link me to the relative topic. Also, many thousand thanks in advance.

First, I am going to describe what I want to achieve as best as possible.

I have a solar system-type animation, and I want one part (the rescue capsule) to be connected to a text window with a line. I already know how to do that, with a beam, don't really need help there. It works perfectly well when I change the position of the object (system_capsule)

My problem though is that when I have the object rotate via pickwhip with a rotation "slave", the beam will not follow the rotation. I know why - the position does not change. Pickwhipping the rotation values of these two parts does not work the way I want it to, as then only the rotation of the capsule is affected, not the relative position to the system's "sun".
I guess my question is, how do I change the position of the object so that it still rotates around the centre point in a circular matter? It might be due to a lack of coffee (or the fact that it is past midnight here), but I cannot for the love of it find a way. Any help would be greatly appriciated and valued.

I have collected the files for those of you who want to have a look at my setup. It was created with CC 2015.3! Added as a .rar
10821_consolerv1cowfolder.rar.zip


Many thanks! It's always great that Creative Cow is a treasure trove for answers to almost any kind of question, and the community here is heart warming. I hope I can in return help some of you with different questions!

Best, Flo

motionkontor.de


Return to posts index

Emre AnilRe: Rotation / Beam Problem in a Solar System Animation
by on Nov 23, 2016 at 11:49:14 am

Hi there Florian,

You just need to rotate your system_capsule with expression so that it's position value is changing over time. Add this expression on your system_capsule layers position property, i'll try to explain it briefly so that you can change values..

radius = 148;
angle = time * 12;
x = radius * Math.cos(degreesToRadians(angle + 180));
y = radius * Math.sin(degreesToRadians(angle + 180));
z = 0;
centre = [573, 373.5, 0];
add(centre, [x, y, z]);

radius is the distance between the system_capsule and center of the composition. Your starting point for the capsule was 425, 373.5 and center of the comp is 573, 373.5 so radius is 573 - 425 = 148

angle is basically the speed of the rotation because it's multiplied with time. you have rotated your space_capsule_rotator 360 degrees in 30 seconds so for 1 second it's 12 degrees.

x and y coordinates is calculated each frame with angle + 180 because at 0 your space capsule starts at the right side of the sun
you don't need the depth so z position is 0

center is the center position of your comp

add function just adds the x,y,z coordinates to the center coordinates


Return to posts index

Florian LiedtkeRe: Rotation / Beam Problem in a Solar System Animation
by on Nov 25, 2016 at 2:27:17 pm

Hey Emre,

thanks for this. So it comes down to math. ^^

I'll try your suggestion tonight.

Thank you for your time!

Best, Flo

motionkontor.de


Return to posts index


Florian LiedtkeRe: Rotation / Beam Problem in a Solar System Animation
by on Nov 25, 2016 at 7:09:58 pm

Hey,

it works like a charm, so thank you a thousand fold!!
I am relatively new to expressions, and math is the bane of my existence. ?

I even got it changing value over time, so the capsule slowly spins inward toward the sun (which is what is happening to it).

For those interested, the expression now looks like this: (the more time, the smaller the radius gets)

t = time;
radius = 148 - t;
angle = time * 40;
x = radius * Math.cos(degreesToRadians(angle + 180));
y = radius * Math.sin(degreesToRadians(angle + 180));
z = 0;
centre = [573, 373.5, 0];
add(centre, [x, y, z]);

The Angle part of this expression, after I changed the length of the comp to 3mins, now determines the angle (sort of) at which the capsule is plummeting towards the sun. So, if I change the value of angle = 12 to angle = 40, the capsule takes longer to hit the sun, if I change it to angle = 2, the fall is much steeper. The capsule still hits the zero point at around 2:30, no matter the value of angle.


Thanks again, Flo

motionkontor.de


Return to posts index

Darby EdelenRe: Rotation / Beam Problem in a Solar System Animation
by on Nov 30, 2016 at 9:35:28 am

I haven't looked at your file but this sounds like you'd benefit from using layer space transforms, perhaps the toWorld() or toComp() methods.

No math required! :)

Darby Edelen


Return to posts index

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