Jump to content
Search Community

MotionPathPlugin: horizontal figure 8

rocketclowns test
Moderator Tag

Go to solution Solved by mikel,

Recommended Posts

Hello GSAP wizards :)

 

I'm trying to set up a Motion Path for a horizontal figure 8, as shown in the attached image.

I thought I was clever, and came up with this motionPath:

 

gsap.to(part.position, {
                duration: 15,
                repeat: -1,
                repeatDelay: 0,
                yoyo: false,
                ease: "none",
                motionPath: {
                    path: [{x: 0, y: 0}, {x: 100, y: -100}, {x: 200, y: 0}, {x: 100, y: 100}, {x: 0, y: 0}, {x: -100, y: -100}, {x: -200, y: 0}, {x: -100, y: 100}, {x: 0, y: 0}],
                    //align: "#path",
                    //autoRotate: true,
                    //alignOrigin: [0.5, 0.5]
                }
            });

 

However, in the resulting animation, you can see that some of those coordinates have a nice Bezier, and others are a bit wonky, or jerky: https://rocketclowns.com/interactive-animation-using-babylon-js/

 

Am I overlooking something?

 

 

Many thanks in advance, Olaf

The-figure-8-orbit-for-three-equal-masses-The-points-show-the-masses-at-five-equal-time.png

Link to comment
Share on other sites

Hi @mikel!

 

That path looks great, exactly what I was going for. Thanks so much! :)

 

Because I'm using this animation in a 3D-space (using babylon.js) I'll have to figure out what the origin x- and y-coordinates of that path would be. I'll let you know when I have some results!

 

Thanks again,

 

Olaf

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.
×
×
  • Create New...