VincentGarreau / particles.js

A lightweight JavaScript library for creating particles
https://vincentgarreau.com/particles.js/
MIT License
28.66k stars 4.81k forks source link

How to rotating polygon particles x deg? #184

Open ssdwho opened 7 years ago

ssdwho commented 7 years ago

I want to rotate hexagon shape 30 degree but how?

kinoli commented 6 years ago

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

ssdwho commented 6 years ago

Unfortunately no.

kinoli commented 6 years ago

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.

artfauxlive commented 4 years ago

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

matteobruni commented 4 years ago

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