Jezzamonn / fourier

An Interactive Introduction to Fourier Transforms
http://www.jezzamon.com/fourier
MIT License
2.47k stars 217 forks source link

How to generate such kind of Fourier style GIF? #19

Open wqw547243068 opened 5 years ago

wqw547243068 commented 5 years ago

Question

Jezzamonn commented 5 years ago

If you're talking about this animation:

Screen Shot 2019-07-09 at 21 28 56

The way I generated it was actually using the page itself! I draw the image with the part that says "Draw Here", although I changed the code so that it printed out the list of points into the browser console, which I saved to here: https://github.com/Jezzamonn/fourier/blob/master/js/points/me-points.js

It's actually not saved to a gif but the page computes Fourier transform on those points, and draws the animation through code. Here is where it passes in those to a new object. https://github.com/Jezzamonn/fourier/blob/b3e7ddc54499c6a4b8ced5364e2e49140320d7fb/js/main.js#L338

If you wanted to make something similar, probably the easiest way would be to just use the page, and draw the image there and then do a screen recording of the animation

Let me know if you have any other questions!

wqw547243068 commented 5 years ago

Further questions:

Jezzamonn commented 4 years ago

Ah, sorry just saw the follow up question!

So that's what I was referring to when I said I made it using the page itself. I drew on the widget that says "draw here", and then got the page to output the list of points to the browser's developer console. The logic is still there actually: https://github.com/Jezzamonn/fourier/blob/76b3212675ace611eb39dbfba323b151c283935d/js/controller/draw-controller.js#L54

So if you draw something on the page and then press 'p' it'll display the list of points.

If you need to know how to open the developer console, search for "open developer console [name of browser you're using]"