Open chrisgannon opened 5 years ago
Thanks for this feature request. Add a 👍 reaction to this issue if you would like to see this feature added. Do not add +1 comments — They will be deleted.
IMO radians is what native JS uses, so its more straightforward to use them rather than introducing a different unit. That said, yeah, there are a lot of times where I'm already thinking in degrees
So rather than have it automatically convert it, is it possible to have it a global variable setting? Of course I can use my own converter - just a nice-to-have! :)
remember a simple function will do the job: degrees = 180 radians / pi radians = pi degrees / 180
@Neon22 Yes I use that already - it would just be nice to be able to set it globally so I don't have to keep manually passing values to it. I'm lazy!
what about a toRadians function as member of Zdog?
illo.rotate.y = Zdog.toRadians(180);
Edit:
I submitted a PR for this feature request https://github.com/metafizzy/zdog/pull/47
I think it's more familiar and user friendly to rotate elements using degrees.
Is it possible to set an optional global variable like
Zdog.useDegrees = true;
.Then any value passed to a
rotate
property is converted to degrees (currently I have to use my own conversion function).