der_lixus Posted December 22, 2019 Share Posted December 22, 2019 I'm upgrading from GSAP 2 to 3. In my script, i've used var bezierData = BezierPlugin.bezierThrough(points); to get bezier segments from an array of points. Is there any way to do this with GSAP 3? Link to comment Share on other sites More sharing options...
ZachSaucier Posted December 22, 2019 Share Posted December 22, 2019 Hey der_lixus and welcome to the GreenSock forums. Yes, you can do this using MotionPathPlugin's pointsToSegment function. Sorry there's not any documentation for it yet but here's the basic usage: // This is what the function looks like // points is an array of x/y points, like [x, y, x, y, x, y] // curviness and cornerThreshold are optional function pointsToSegment(points, curviness, cornerThreshold) {} // This is an example of how to use it MotionPathPlugin.pointsToSegment([0, 0, 100, 200, 450, 700], 1, Math.PI / 10) 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now