Friday, September 12, 2008

Elevated Surface Image for World Wind Java

A few WWJ forum members have asked whether it would be possible to have a surface image that could be rendered somewhat 'up in the air' instead of painted on the globe surface. The idea would be to show the global clouds image for instance at 10 km altitude. Although the feature is not part of the actual SDK, i happen to have created some time ago a sub class of SurfaceImage that does exactly that.

Download (updated for WWJ 0.6 December 7, 2009), remove the .txt extension and add to the SDK render package.

The class is very similar to SurfaceImage and is instantiated the same way, but the texture will be painted on a 'flat layer' at a given altitude that must be set using the setElevation() method.

Note that the cloud image does not contain an alpha channel and will obscure the underlying imagery. In the .net version of World Wind, the "Global Clouds" plugin does some post processing after each new image is downloaded to create an alpha channel and save the resulting image as a .png. In that case the alpha is just a copy of the black and white cloud image.

However, i found you could get somewhat better results by replacing the cloud image with plain white - the alpha channel will then 'modulate' the white and produce a more realistic effect without the 'greyish' shades where the cloud coverage is less then one hundred percent.

The bottom line is that some additional work is to be done to get a decent global cloud image over the World Wind Java globe, even with this 'elevated' surface image class. The above screenshot is using a static post processed image - not the 'real time' online version.

Another usage of this textured layer could be to use a plain blue texture with some transparency and somewhat simulate the sea level as with the "Global Flood" plugin (see this forum thread).

Monday, September 1, 2008

Truncated Earth in World Wind Java

I wanted to try this for a while and i'm pleased to see it works rather well considering how little code is involved. Here is a simple World Wind Java example application that will produce a truncated globe.

Download, remove the .txt extension and add to the SDK examples package.

Update Nov. 20: once again there appear to be a dependency on the not yet publish SDK 0.6. Please check this forum post for a workaround with version 0.5.

The code illustrates how to extend and override the globe elevation model to 'take out' a slice of the planet. Although rough coloring of the section interior is easilly done with some gradients and surface images, placing a texture on the section side would require a bit more then that.