Jump to content
GreenSock

jp_uk81

Planet Orbits (Linked animations)

Moderator Tag

Recommended Posts

Hi Guys, 

I'm trying to make this simple planet orbits animation but I finally hit the wall achieving this astronomical mess.

I know I need to somehow make the planet a child of the orbit animation but I'm not sure how.

 

Thank you in advance

Gp

See the Pen dybJeLe by gianpiero-di-lullo (@gianpiero-di-lullo) on CodePen

Link to comment
Share on other sites

Hey @jp_uk81,

 

Maybe this pen helps ...

 

function mapToPath() {
  var path = MorphSVGPlugin.pathDataToBezier(orbit, {align:planet});
  //create a tween of the planet along that path and jump to the progress that the timeline is at.
  TweenLite.to(planet, time, {bezier:{values:path, type:"cubic"}}).progress(action.progress());
}

See the Pen gyYWEe by mikeK (@mikeK) on CodePen

 

Happy tweening ...

Mikel

  • Like 5
Link to comment
Share on other sites

1 hour ago, ZachSaucier said:

Also relevant, without an explicit path:

 

You might want to set the body overflow to hidden. The scrollbar on Windows is going crazy in the embedded view.

  • Like 2
Link to comment
Share on other sites

Thanks guys, 

I've achieved some kind of sync between the orbit rotation and planet anim but I can't understand how the progress() works...

it only gets the time of the orbit1_anim?

 

See the Pen dybJeLe by gianpiero-di-lullo (@gianpiero-di-lullo) on CodePen

 

Link to comment
Share on other sites

Check out the progress docs :) 

 

What's your goal here? I'm not sure what you're hoping to do in rotating the orbit like that. 

Link to comment
Share on other sites

Nice work! 

 

Generally speaking it's good to make forks (new versions) of your demos each time you post it so that others viewing the thread later can follow along with what happened. Don't worry about it in this case :) 

Link to comment
Share on other sites

ok thank you Zach, I'll keep it in mind next time

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×