Pendulums, WebGL and three.js

02 December 2011

Here's the waves pendulum three.js simulation I made.
 So I wanted to simulate a magical pendulum with waves to prove my point that the shapes are the result of a dead simple arithmetic progression. I was almost correct.
After testing, I saw that when the frequency is an arithmetic progression we get the awesome patterns. The problem is that achieving such a feat by modifying the length of the strings alone is a bit harder. Here's omega, or the angular frequency from hyperphysics: w = sqrt(g/L) So all I had to do was choose omegas, increment them and from that calculate the string lengths. I got mixed up and solved the problem in a much more complicated way. Anyhow, by faking it (choosing my omegas with bogus L's) I get a prettier result. Headache averted. I'm not sure these swing angles are simple pendulums anyway. WebGL and three.js are indeed awesome. It does have its gotchas but I was just so impressed with and other things in the three.js gallery. It's amazing how simple and accessible opengl is now that it's in the browser. The "hello world" of about 20 lines for a rotating cube was good though I think it should include the WebGL detection in it.