wbolden / complex

WebGL Complex Function Plotter, also includes support for dual and split-complex numbers
https://wbolden.github.io/complex/
23 stars 5 forks source link

Possibility to add a "time" global variable for animated plots? #3

Open zxol opened 1 year ago

zxol commented 1 year ago

Just wanted to say thank you so much for this, it legitimately one of my favorite pieces of software, I've spent many hours exploring and hunting for mathematical jewels :)

I have a feature idea, but I'm a bit hesitant to suggest it as it looks like you created this a long time ago, and have other fish to fry.

Would it be possible to introduce time and frame delta floats into the rendering pipeline, and a play/reset button, in the style of shadertoy.com?

If you're to busy, but are open to a PR (or just a fork), I could take on the task, but I might need to send and email or two to get my head around the code.

Again, thanks so much for making and sharing this.

wbolden commented 7 months ago

Sorry I didn't see this earlier. Great suggestion! I've changed it so the variable "t" is now linked to the current timestamp, so whenever you use the variable t in a function it will animate. I also added an option in the settings to change the FPS cap of the animation (default is 30). This isn't quite what you suggested but should have similar results. Feel free to open a PR or fork if there are any specific changes you want to make.

Example functions: zsin(z)e^(it) sin(z+t) {z'^2+sin(t/2),z,10}