Morphing a polygon?

Hi!

Is there any way to morph a polygon, meaning to move it’s vertices from one configuration to another by supplying a new list of x,y coördinates, or transitioning to one?

I need to create an effects where one shape with 8 vertex points morphs into another shapes with 8 vertex points, and it’s hard to animate any other way…

Thanks,

Thomas

By the way, it needs to be 8 vertices, so the quad distortion trick won’t do…

i don’t believe there’s anything you can “do” with polygon.path (fe, setting a specific vertex), so dead end there.  maybe a vertex shader if your intended effect is conducive?  otherwise, recreate from scratch each frame.  (tho note this might cause a need to fix position too - if the deformed poly’s implied “center” becomes offset from its content bounds’ center)  hth

Hi @thomas6,

There is no such thing as a “PolygonPath”, so you can’t manipulate the vertices. In fact, polygon objects don’t support quadrilateral deformation at all (see this guide).

You could potentially re-create the polygon (performance should not suffer greatly), and shift the anchor point to keep the polygon in alignment.

Best regards,

Brent

By the way, it needs to be 8 vertices, so the quad distortion trick won’t do…

i don’t believe there’s anything you can “do” with polygon.path (fe, setting a specific vertex), so dead end there.  maybe a vertex shader if your intended effect is conducive?  otherwise, recreate from scratch each frame.  (tho note this might cause a need to fix position too - if the deformed poly’s implied “center” becomes offset from its content bounds’ center)  hth

Hi @thomas6,

There is no such thing as a “PolygonPath”, so you can’t manipulate the vertices. In fact, polygon objects don’t support quadrilateral deformation at all (see this guide).

You could potentially re-create the polygon (performance should not suffer greatly), and shift the anchor point to keep the polygon in alignment.

Best regards,

Brent