particles.js icon indicating copy to clipboard operation
particles.js copied to clipboard

How to rotating polygon particles x deg?

Open ssdwho opened this issue 7 years ago • 5 comments

I want to rotate hexagon shape 30 degree but how?

ssdwho avatar Mar 12 '17 21:03 ssdwho

Did you figure out how to rotate the shapes? I am in need of the same.

kinoli avatar Mar 28 '18 16:03 kinoli

Unfortunately no.

ssdwho avatar Mar 28 '18 16:03 ssdwho

I've figured out how... with a hack to particles.js. In the drawShape function add this for a 30 degree rotation.

c.rotate(30*Math.PI/180)

Just add it somewhere above the for loop.

kinoli avatar Mar 28 '18 17:03 kinoli

How about a continuing rotation or maybe I a loop rotation. (forgive me I'm new at this and I'm old lol

artfauxlive avatar Jun 09 '20 01:06 artfauxlive

@artfauxlive this library does not support rotation, try https://github.com/matteobruni/tsparticles, it can animate it too

matteobruni avatar Jun 09 '20 04:06 matteobruni