usernolan Posted February 17, 2020 Share Posted February 17, 2020 Hi there! This might be more of an SVG composition question than an MorphSVGPlugin question, but hoping someone might be able to lend some tips on achieving the right effect for this: See the Pen qBdZxJO by nolan330 (@nolan330) on CodePen In the pen, you might notice that the morph "primarily" expands the pentagon into the dodecagon, with the triangle and square sort of collapsing ("merhhhh...") into single points respectively. I'm wondering how I might be able to refine the morph, perhaps using shapeIndex or tweaking the SVG itself, so that the 3 independent shapes more "equally" contribute to the final dodecagon. (I apologize I don't have a more precise vocabulary for this!) The idea was that 3 + 4 + 5 = 12 (points), and 2 * 2 * 2 = 8 (stroke, who knew stroke grew exponentially!?), so the 3 original closed shapes might sort of compose smoothly into the final dodecagon. I think it could look pretty neat if configured correctly, but it seems like it will depend on a more clever path for the 3 independent shapes. So far, I've tried kind of a "cheat", where the shapes are just one continuous line, but I think it could still be improved: See the Pen LYVNQmp by nolan330 (@nolan330) on CodePen I also tried changing the shapeIndex on the continuous line, but it doesn't seem to significantly impact the outcome: See the Pen oNXxEyb by nolan330 (@nolan330) on CodePen In any case, any tips or feedback welcome! And I apologize if this is more of a SVG fundamentals question/unfit for the forum. -nolan See the Pen by (@) on CodePen Link to comment Share on other sites More sharing options...
usernolan Posted February 17, 2020 Author Share Posted February 17, 2020 Here is another compromise, where the shapes are sort of trivially connected, which gets a little bit closer, perhaps: See the Pen ZEGWrVZ by nolan330 (@nolan330) on CodePen 1 Link to comment Share on other sites More sharing options...
GreenSock Posted February 17, 2020 Share Posted February 17, 2020 Yeah, I like your 2nd post best. Have you tried literally taking the end shape, making a copy of it and just dragging each point to the corresponding place in the starting shape(s), and then use that as the starting shape? It is technically possible to have the beginning shapes break apart and form the ending one, but it's definitely advanced and would take some effort. It'd likely involve configuring the raw data string with various "M" commands (one for each starting shape) and messing with the coordinates so that the end shape has the "M" commands butted up next to each other and then animating the raw "d" value of the <path>. 3 Link to comment Share on other sites More sharing options...
usernolan Posted February 17, 2020 Author Share Posted February 17, 2020 Really appreciate the feedback @GreenSock! I’ll try more deliberate point dragging, which is a great idea, and may also take a shot at the more advanced approach too. It’s a good reason to learn more about SVG internals. In any case it’s great to know that something like that may call for going lower level. 1 Link to comment Share on other sites More sharing options...
usernolan Posted February 19, 2020 Author Share Posted February 19, 2020 Using a fill makes it a little easier to orchestrate something that starts to make sense: See the Pen yLNJZJP by nolan330 (@nolan330) on CodePen Getting close enough for what this will be used for, for now. If anyone catches anything similar or related, I'd love to see it! 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