perjantai 27. elokuuta 2010

N-body simulation

Here is an example of GPU accelerated physics using WebGL. The physics in the sample include simple collision handling and gravitation. There are no optimizations in the code, so each object is checked against each other object. Some features that could be useful are springs for making complex objects and collision detection with triangles to implement walls etc.Just as in the previous sample, Firefox 4 beta is needed to view the page. To implement the simulation, 24-bit colors are used to represent fixed point values. Hopefully there will be an extension for WebGL that supports floating point textures natively.

sunnuntai 22. elokuuta 2010

First post!

Last night I tried to write a code to simulate flow of raindrops on a window, but it didn't go exactly as expected. Here is the result. To view it, you need Firefox 4 beta with WebGL enabled. This system is a special case of Cellular automaton, which can be thought to be a discrete version of a physical field. Perhaps I should write some more interesting physical simulations this way.

I think this was a good way to open this blog. I will post about my projects next week.