I'm trying to smoothly morph a square into triangle, in which the top corners slowly move towards each other, and meet in the middle.
If you look at the Codepen, you'll see two rectangles turning into a triangle, one after the other, and in different ways.
This was my process: I created the two SVGs in Illustrator. I created a 1-pixel stroke rectangle with a transparent fill, clicked Object > Expand, and then saved the SVG using "Save for Web and Devices". The triangle was created similarly, this time by adding an anchor point in the middle of the two top corners of a square, and then deleting the other two anchor points, expanding, and then saving.
In the Codepen, you'll see I used the basic line
TweenLite.to("#rectangle", 1, {morphSVG:"#triangle"});
to morph my two paths.
Three questions, please:
1) What's the Illustrator workflow for making single-line SVG paths in Illustrator? Like what I'm trying for above, but maybe something with curves next time.
2) How about filled shapes?
3) Am I correct in thinking I'll need to play around shapeIndex to get the animation I want?