neo420 Posted December 3, 2019 Share Posted December 3, 2019 Hello, First of all thank you for this great library I have multiple point (html element) and I'm moving a "pen" from point to point with MotionPathPlugin . So i have my array of object, my pen is moving fine, but I'm having trouble trying to figure out how to output a rawPath from those points. Is there a way ? Thank you ! See the Pen wvBBGKr by benmcarnolds (@benmcarnolds) on CodePen Link to comment Share on other sites More sharing options...
ZachSaucier Posted December 3, 2019 Share Posted December 3, 2019 Hey neo and welcome to the GreenSock forums! Thanks for the kind words. Are you just trying to get the raw path from the array of points? If so, you can use MotionPathPlugin.arrayToRawPath() let rawPath = MotionPathPlugin.arrayToRawPath(stepsCoordonates); console.log(rawPath); Link to comment Share on other sites More sharing options...
neo420 Posted December 3, 2019 Author Share Posted December 3, 2019 Thank you for the fast reply Actually i want to draw a line when my pen is moving, so creating a svg from my points could help. I'm not a big expert of svg but it seems like I have what i need with arrayToRawPath, haven't I ? Link to comment Share on other sites More sharing options...
ZachSaucier Posted December 3, 2019 Share Posted December 3, 2019 1 hour ago, neo420 said: Actually i want to draw a line when my pen is moving, so creating a svg from my points could help. Ah, I see. 1 hour ago, neo420 said: I'm not a big expert of svg but it seems like I have what i need with arrayToRawPath, haven't I ? More or less I'd use GSAP's DrawSVG to do that: See the Pen OJPPRER?editors=0010 by GreenSock (@GreenSock) on CodePen It might take a little bit of manipulation to get them to line up correctly. 1 Link to comment Share on other sites More sharing options...
neo420 Posted December 4, 2019 Author Share Posted December 4, 2019 Great, this is what I need ! Thank you very much Zach, have a nice day Link to comment Share on other sites More sharing options...
Jim Tim Posted January 28, 2022 Share Posted January 28, 2022 @ZachSaucier // Are you just trying to get the raw path from the array of points? If so, you can use MotionPathPlugin.arrayToRawPath(), Absolutely yes, but the method bezierThrough() in version-2 return a different format of values. is there any possible way to get the similar values which is return in version 2 method using MotionPathPlugin. Link to comment Share on other sites More sharing options...
OSUblake Posted January 28, 2022 Share Posted January 28, 2022 Hi Jim Tim, Please don't @ people in an old thread. It's best to always create a new topic if you have a question, but I'll answer your question in the thread in a few. 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