Jump to content
Search Community

MorphSVG Distortion

samwatts1988 test
Moderator Tag

Go to solution Solved by Cassie,

Recommended Posts

Hello! It’s my first time using GSAP and I’m really enjoying getting to grips with it but I’ve included a CodePen below which demonstrates an issue I’m currently having with MorphSVG. 

 

As you’ll see the animation between #stage-1 and #stage-2 works seamlessly, however when animating from #stage-1 to #stage-3 the morphing distorts quite heavily when animating between those shapes. What I’d like #stage-3 to do is morph the curves out of the curve/arch, if that makes sense. 

 

I believe I’ve followed the docs as detailed however I can’t work out whether I’ve made a classic newbie error or if there’s a more complex consideration at play here. Any pointers or help with this would be hugely appreciated!

 

Thank you! 

See the Pen LYOOjgQ by samwatts1988 (@samwatts1988) on CodePen

Link to comment
Share on other sites

Have you seen findShapeIndex() (https://greensock.com/docs/v3/Plugins/MorphSVGPlugin) index within the docs? 

 

See the Pen wvPPpBY by mvaneijgen (@mvaneijgen) on CodePen

 

With `shapeIndex: [4]`, It is not exactly what you want, but you can get it a lot closer 

 

See the Pen WNXXdoW by mvaneijgen (@mvaneijgen) on CodePen

 

It has to do with the number of points on the shape and your stage-3 arch has a lot more points that need to move. I would try when you've got the final shape add some more points to your stage-1 shape, so that it doesn't have to move the points around so much 

  • Like 2
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...