Saturday, September 15, 2007

The dilemma

Looking at the WWJ source code, I feel very happy. Honestly, my work in the Balloon's project core API is not as complete as the WWJ API:
  • not use any geode to calculate lat/lon,
  • not use the concept of LevelSet,
  • and more important, I don't implement any elevation model, my world is flat :(
Take in account nothing is perfect. Currently WWJ has a big problem with rendering vector data (polygons and points) in the surface (using elevation model).

The good things
On the other hand. Balloon is a one person project, and I think my work is enough good:
  • Balloon speed is similar to WWJ, inclusive when data are loading (remotely and locally at the same time).
  • Although my core API (my SDK) is simpler than WWJ, Balloon is a desktop application not only a SDK, it has a GUI module.
  • All objects allow change its features like: color, transparency, etc, without any distinction. This is not possible in WWJ with many layers.
  • All renderable objects are, optionally, timestamped and those Balloon can animate information.
  • Recently I was finishing the pick selection process of objects, and I want to improve GUI calculating the lat/lon position of the cursor in the screen.
The sentence that resumes my spirit and is enough for me to continue working is:
I want to improve the core API for the simple reason to learn and develop more and better.

The bad things
The problem is that for one person, develop the core API and GUI is too much job, and then the dilemma comes to me:
Why spend time in the core API if there exists a good API that makes something similar and, in more areas, better? Why doesn't use WWJ as the core API in the Balloon project?

Conclusion
I think I stop my project for a while, start learning more in WWJ API and trying to implement my existent layers and animation time concepts with the WWJ.
I think the real prolem is I don't know how to focus Balloon project Create another virtual globe? Focus it as another GIS application?

Finally I am thinking Why don't make a fork of the project: one using my core API and one using the WWJ API?

Sunday, September 09, 2007

Picking objects

After some days of work I have finally added the picking mechanism to the project. Now the objects can react when mouse is moving, button is clicked, pressed or released.
It is based on picking and selection mechanism of OpenGL and doesn't affect the performance in a visible way.
I'm happy :)

Tuesday, September 04, 2007

My first hack on WWJ

It is not any amazing thing but I want to show my first hack on WWJ code. Really this is the second hack, the first is my LayerSet class that allows create set of layers.

I have modified a bit the WWJ source code (in the SurfaceTileRenderer class) to allow some layers make use of the, until now not used, property opacity.
For example you can put a BMNGSurfaceLayer but you can change its opacity, or better said, you can invoke the setOpacity method but the opacity value is never used in the render process and thus the layer never changes its opacity.

Take a look at this two screenshots. The first is a normal set of layers:


The second shows the CountryBoundariesLayer and the landsat layer with opacity changed:


Which is the secret?
You know some layers like BMNGSurfaceLayer, CountryBoundariesLayer and USGS* are based on BasicTiledImageLayer that extends the TiledImageLayer class. The later class uses the SurfaceTileRenderer to render the tiles.


In
TiledImageLayer.draw() method change:
dc.getGeographicSurfaceTileRenderer().renderTiles(dc, this.currentTiles);
by
dc.getGeographicSurfaceTileRenderer().renderTiles(dc, this.currentTiles, this);

In SurfaceTileRenderer change:
public void renderTiles(DrawContext dc, Iterable tiles) {
by
public void renderTiles(DrawContext dc, Iterable tiles, AbstractLayer layer) {

and put this code (only the later 'if):
...
if (!dc.isPickingMode()) {
gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);
} else {
gl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_COMBINE);
gl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_SRC0_RGB, GL.GL_PREVIOUS);
gl.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_COMBINE_RGB, GL.GL_REPLACE);
}

if(layer!=null){
// Set transparency
gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_MODULATE);
gl.glColor4f(1, 1, 1, (float)layer.getOpacity());
}
...

Finally, create overload the method (to not affect other calls):
public void renderTiles(DrawContext dc, Iterable tiles) {
this.renderTiles(dc, tiles, null);
}

And thats all.

Thursday, August 30, 2007

Returning...

Well, holidays are finished and we come back to the work. I didn't spend much time on the project but in my free time I did:
  • improved the WMS wizard,
  • added tilt rotation to the camera (similar to the WWJ), and also
  • I have started to play the WWJ source code.

As a result of this third point I show you a screenshot:


In there is no direct way to group layers, because this I have create a LayerSet class that can group layers.

The image shows the layers: BMNG, compass, landsat and finally country boundaries.

Thursday, August 02, 2007

More improvements

Finally I'm on holidays. Also I have finished refactoring the core API to work with listeners (take a look at previous post).

Today I want to post about a couple of new user interface improvements I have made thanks to the previous work.
Now, when the user loads some data (image, shapefile or WMS layer) a progress bar is shown:



And once the data is loaded, depending if the data can or can't be loaded, the label in the layer explorer change its color to show the final state:

Monday, July 23, 2007

Improving the model

Later I had worked on the logical model. Among other things Balloon has classes responsible to render graphic object and classes responsible to load data. I have just improved this using an event/listener mechanism.
Also I turn many java classes on JavaBeans, firing property change events and so on that helps to improve the client programming.

Finally I have divided the load process between synchronous (working in the update thread) and asynchronous process (working in a new thread). For example, to load WMS images the load process starts as a synchronous process, checks if the images is cached in the local disk and if so loads it, otherwise changes it to an asynchronous mode and loads data from the network server.

Probably it must be better to write some docs to help the future programmers of Balloon ;)

Tuesday, July 10, 2007

WMS and cached images

This is a little demo which works with WMS layers with some cached images.



Other time, sorry by poor quality but (1) my video card is not so good and it is very dificult to execute and capture at the same time, and (2) youtube takes a lot of quality.

Saturday, July 07, 2007

Working with WMS server

Here is a demo video working with WMS server.
The first step in the wizard is to select the WMS server and the second step is to select the layer (or layers) you want to load.
The load speed depends both on the server and your network speed. As you can see in the vieo, my network speed is poor.
Also I want to note my computer is not so good to work with balloon at the same time we are recording screen. In addition YouTube lows the qualitit of the movie.

Wednesday, July 04, 2007

A couple of demo videos

Here are the first demo videos of the balloon in action.
Unfortunately I captured it only at 10 FPS to save space and also YouTube reduce it much more, making the false ilusion it is slow.

Here are a basic work with georeferenced images and the GUI layout:


Here you can see how easy is to work with shapefiles (with lat/lon data):