Sunday, November 14, 2010

Stuck in reverse

Well I am getting a bit of progress on the 3D viewer and physics stuff, but it is rather slow. Part of the things that I wanted to try is to reverse engineer a real object and load it in a simulated WindTunnel (Physics engine) to run a basic test on that. This has lead me to create a very basic laser scanner at home, its very primitive at this point of time and I do not intend to go deep into developing the one giving best results, its too early.

optical setup

Turn table using a slow motor

The Math has also gone slightly out of hand there the object placement is a bit inaccurate, I need to get back to the basics and work out that part again, but it gives some sort of results as of now although not very accurate ones :-)

For generating the points here are the steps I have followed, ideally a single program should do those things automatically...
1) Capture a video by a fast camera
2) Take screenshots through program like SMPlayer
3) Calculate angular displacement of the model and use the equations mentioned in the reference articles

The image processing component is written by me, but the viewer is not able to handle so much data at the moment, hence an opensource tool GMsh is used for point visualisation.

---
References:


Thursday, November 4, 2010

Physics engine roadblock

I guess I should have seen this coming before (day before). After writing some bits and pieces of math and particle physics code, I realised that the visualiser application is not capable enough to test things. There is a dire need for overloaded key handling and mouse based entity editing and navigation. Also I cannot go on adding buttons for each and every functions, this calls for a JRuby interpreter on the visualiser. Need to spend some time on the gui front to get it up to the mark next.

Wednesday, November 3, 2010

Casual programming... Physics engine from scratch


In the vacation time, I have decided to write a physics engine of my own from scratch as a hobby project. It would be a good brain workout after regular work. At the end I would learn a few things.

I have already developed a collision detection and physics engine for mobiles in java before... it was mostly linear physics.

Primarily I would like to aim at creating a good particle physics engine at first. This would allow me to simulate a few things on 3D models like fluid flow around the objects etc...

First thing I tried to develop is a framework to experiment in... yes a 3D viewer. The viewport is 80% complete I have yet to add elegant navigation code. Screenshot is attached, doesn't look pretty now hopefully it will later. Next would be to write a collision detection engine with basic ray intersection tests its not as difficult as it sounds.

Aim is to develop this in java so that parts of it can also be available online. Also it has been a long break of around 3 years from Java so it will be good to learn the new stuff I've missed. This application would have a JRuby interpreter which would allow me flexibility to write small scripts at runtime.