Easy AJAX using jQuery 

Filed under: miscellaneous on Saturday, October 18th, 2008 by admin | No Comments

Small update: You can see the code live here if my computer is online.

The “new” Javascript libraries ease the use of AJAX a lot: With these two simple code snippets

(A simple Servlet for searching through /usr/share/dict/words and a simple jQuery/Javascript -Script) I was able to create an autocompletion form in a few minutes:

Apache’s little brother 

Filed under: miscellaneous on Saturday, October 18th, 2008 by admin | No Comments

I want to play around a bit with modern web technologies and JavaScript (AJAX, JQuery, JavaScript in general) and was in need of a webserver. Since all I found where either difficult to setup or quite complex to configure (and I was bored so wanted something to hack, too) I implemented my own small and probably totally insecure webserver in Java. It

  • is multi-threaded
  • supports a simple form of Servlets and provides rudimentary transformation of GET-requests
  • has a parser to modify served files on delivery, useful for templating
  • is quite small (around 380 LOC)
  • very easy to setup and use in other Java projects

Write me a mail if you’re interested in the code. And not to forget the obligationary screenshots (well, of the served page and servlet call)

Improved Barnes-Hut 

Filed under: miscellaneous on Saturday, October 11th, 2008 by admin | No Comments

Finally I found some really mean bugs and I’ve learned again that in 99.9% of the time the source of the bug is neither the JVM, the language or the algorithm but the person in front of the computer ;-). The (non-parallel!) implementation of Barnes-Hut runs for ca. 77 seconds where the standard all-pairs algorithm takes around 600 seconds for the same data set.

Barnes-Hut 

Filed under: miscellaneous on Tuesday, October 7th, 2008 by admin | No Comments

At the moment I’m implementing the Barnes-Hut O(n log n) algorithm for n-Body problems. This will be my initial point for further research on some special parallel aspects of it.

(Screenshot of a visualization of the Barnes-Hut Quadtree and Center of masses)

Side² Project (+ research) 

Filed under: miscellaneous on Thursday, September 18th, 2008 by admin | No Comments

Since I’m currently working (as part of my research) on some special optimizations of n-Body problems I don’t have a lot of time for the raytracer. Here’s a screenshot of the framework I’ve written to test my ideas. You see a non-parallel all-pairs simulation of 10 Bodies:

(click for a bigger image)

Probably I’ll find more time for the raytracer in a week or so…

Procedural textures 

Filed under: raytracer on Wednesday, September 10th, 2008 by admin | No Comments

Prozedural textures were easier to implement than I thought. But without antialiasing it looks quite ugly:

It’s a bit better when the resolution is much higher:

(Click on the image for a version in 1600×1000)

Multiball…! 

Filed under: raytracer on Wednesday, September 10th, 2008 by admin | No Comments

Doing some stress tests at the moment…

Shading 

Filed under: raytracer on Wednesday, September 10th, 2008 by admin | No Comments

Not quite Phong-Shading, but at least my spheres are shaded now. Implemented the possibility for multiple light soures, different light intensities, switchable shadows and especially shading (based on the simple Lambertian-Model):

A video showing how changing the light intensity alters the scene is here:

PS: While I was developing, I played a bit with the colouring. One of the better results were

Bug hunting 

Filed under: raytracer on Wednesday, September 10th, 2008 by admin | No Comments

It seems there was an error in the formula for the ray-sphere intersection calculation — after calculating a few samples and the general formula manually, I found them. This was quite surprising, because — lazy as I am — I took the formulae from a book about graphic programming. Anyway, everything seems to work now:

Next step (after simple refactoring, as always) is phong-shading.

Shadows working 

Filed under: raytracer on Tuesday, September 9th, 2008 by admin | No Comments

Finally, shadow functionality implemented. The code is still a bit messy (but I love refactoring anyways). Two screenshots as a proof (using the new floor object, too):

And because I like youtube, I also generated a small animation, where the y-coordinate of the light source is raised step by step:

Next on the todo list is, after a lot of bug fixing and refactoring, the implementation of phong-shading. This will be a bit more difficult than the other, already implemented, features.