Thursday, June 5, 2008

My First Java Simulation

About three and a half years ago, I ran across the simulations of a ribbon break in the space elevator that Blaise Gassend had posted on his website. He was generous enough to include the C source code.

At the time, I had planned on re-writing his simulation in Java, both to learn how the simulation was put together, as well as to polish my programming skills in that language. My plans had been to write a simulation that would be accessible from a web page, exposing enough knobs and levers into the simulation to allow users to play with it. I was also interested in simulating a 'space hoist', a variant of the space elevator discussed on the Liftprt discussion boards which uses a looping, untapered ribbon that is moving.

I stopped working on the project at some point, and it sat in a folder on my bookshelf ever since.

Last week, I ran across all the notes, and decided to give rewriting the simulation another go. I downloaded Eclipse as my development environment, and used the javax.vecmath package from java3d as a vector math library. I'm only able to work on the project late in the evenings after dinner, and typically after my daughter goes to bed. I got the 'math engine' parts of the simulation up and running last night in Java, and am working at doing a little more class restructuring to make it look less like C. Once that is done, I need to build and code the graphics portions of the simulation, as well as whatever user controls that I want to put in place.

I want to get a working version equivalent to the one Blaise had running first, and then start playing with variants. Two variants that I would like to do are the aforementioned 'space hoist', as well as a simulation of a space elevator on Saturn's moon Titan (where Saturn's gravity needs to be accounted for as well as Titan's gravity, and perhaps some of the other moons as well).

No comments: