Jump to content
Search Community

Bezier Path Animation Fun

swampthang test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I'm playing around with

See the Pen bpXpYv?editors=0010 by osublake (@osublake) on CodePen

from some time ago. I love the simplicity of the way it works without all the hassle of handles, etc. What I'd love to be able to do, is start with a simple line like that (with 3, maybe 4 points) and add the ability to click to remove, or click the line to add another point. 

 

Had anyone done something like this? Something that would merge the 2 in a very simple way?

See the Pen MGmZbP by swampthang (@swampthang) on CodePen

Link to comment
Share on other sites

2 hours ago, swampthang said:

Any closer to making that an official plugin?

 

No, that was never our plan. I was very reluctant to even share that with anyone, lest it create expectations. I probably shouldn't have even mentioned it in the forums, but hopefully it helps you somehow. 

 

Enjoy!

Link to comment
Share on other sites

Thanks, Jack. I'm seeing some issues with it in my setup so probably will go a different direction. What I need really only requires a simple setup so, hey, maybe it's time for me to become more intimately familiar with bezier's!

Link to comment
Share on other sites

I've trying to stay with quadratic bezier control-points. I know this isn't a GSAP option - GSAP is working exactly as expected - as usual :-) but here' a new codepen with an additional end-point and control point. It works but the second control point handle isn't being calculated properly when the previous end-point or new end-point is dragged. Wracking by noggin trying to figure out why. 

 

See the Pen YLQJzZ by swampthang (@swampthang) on CodePen

Edited by swampthang
Updated link to codepen that now works
Link to comment
Share on other sites

Wow, Jack, thanks so much. As long as I've been doing this, I still can stare right at a mistyped variable and miss it. That was it!

...and thanks for the push to bezierThrough. I think I see what you're talking about in terms of how that could be useful in fleshing out more complex paths.

  • Like 1
Link to comment
Share on other sites

Wow, Blake. Great demo! That does a great job of showing off the curviness property. Contrast that to the one from which it was forked.

 

UPDATE: I added a fork of Blake's version with a field for setting curviness and a reset button for the bezier. 

 

See the Pen ELQmpG?editors=1010 by swampthang (@swampthang) on CodePen

 

Edited by swampthang
addition
  • Like 2
Link to comment
Share on other sites

I'm playing with reversing the animation along with auto-rotate and wondering if there's a way to keep the plane in the following codepen from flying upside down. I'd like to figure out a way to be able to follow a path moving forward and then backwards with autoRotate but not turn upside down. Any way to automatically do this?

 

See the Pen wjXrYw by swampthang (@swampthang) on CodePen

 

 

Link to comment
Share on other sites

Yea, I thought about that too, but, for example, if a path makes a hard turn, the object rotates around it, as you might expect. What I'm wondering is if there's a good, clean way to detect that sort of change in a path and auto adjust scaleY or if there's possibly a setting for that. I know there are some options for autoRotate but my feeble brain is going 'tilt!' Take a look at this pen to see what I'm talking about. Would love to keep the airplane upright at each turn when auto-rotate is set.

 

Link to comment
Share on other sites

  • 1 year later...

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