

Using beam tracing to calculate reflections in JavaScript - kabla
http://blog.kaistale.com/?p=1132

======
bingaling
See also: [http://zenphoton.com/](http://zenphoton.com/)

(use shift+click to move the light source)

[https://github.com/scanlime/zenphoton](https://github.com/scanlime/zenphoton)

------
IvanK_net
I have also written polygon ray casting function a year ago. It can process
thousands of rays at 60 FPS.
[http://polyk.ivank.net/?p=demos&d=raycast](http://polyk.ivank.net/?p=demos&d=raycast)

------
fluffyduffy
It really never ceases to amaze me the things you can do in JavaSCript. That's
the kind of thing that up until a few years ago you'd be hesitant to do in
Java. This is really cool stuff! I look forward to when we get full powered PC
games done in JS. We're not there yet, I know - but it's little steps like
this that'll get us there.

~~~
kabla
I agree, the speeds you can achieve with JavaScript are astounding. They are
far superior to Python, it's a shame JS doesn't have that well of a support
for scientific calculations.

~~~
sgwooduk
If anyone could list what support there is that'd be really interesting.

------
nixarn
Tons of cool stuff on that blog!
[http://blog.kaistale.com/](http://blog.kaistale.com/)

------
dllu
See also: [http://www.laservex.com](http://www.laservex.com)

------
cocoflunchy
How do you choose the angles at which you send the beams and the number of
beams? It appears to be somewhat random, even though I'm sure it's not.

~~~
kabla
The algorithm calculates _all_ possible specular reflections up to some order.
I really don't think I can explain it any better than this paper:
[https://mediatech.aalto.fi/~samuli/publications/laine2009aa_...](https://mediatech.aalto.fi/~samuli/publications/laine2009aa_paper.pdf)

~~~
cocoflunchy
Thanks, I'm going to read up on this.

------
robmiller
As someone who dabbles heavily in acoustics with javascript, THANK YOU! Let's
talk.

~~~
notthetup
Makes the three of us.. Nice work OP!

P.S. Also a fan of threedB @robmiller.. :)

~~~
kabla
It's great to stumble upon like-minded people on HN :-)

