Thursday, April 3, 2008

WorldWind Java Splash Screen

Nothing fancy, fast or optimized, just a frame with the NASA WorldWind splash bitmap that has been in the SDK since day one.


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

To use it, create a no argument new instance of SplashScreen at the beginning of your application main() and dispose of it just after the main frame has been set visible.

Disclaimer: note that a 'good' splash screen that displays fast without slowing your application startup is somewhat a 'hacky' business for which you can find various kinds of tricks. This example doesn't implement any of them, and will likely make your program slower to start.

Thursday, March 20, 2008

OpenStreetMap layer for WorldWind Java

WWJ forum user linnuxxy asked whether OpenStreetMap data could be displayed in WWJ to which m_k provided quite a few useful pointers. This layer will access the 'osm-4326-hybrid' WMS layer from hypercube.telascience.org. Although it is not quite up to date, it renders nicely over the WorldWind terrain.

OpenStreetMap layer for WorldWind Java
Download OpenStreetMapWMSLayer.java - remove the .txt extension and add to the SDK layers.Earth package.

You may want to try the 'osm-4326' too - same thing on a white background (with additional shading below):

OpenStreetMap layer for WorldWind Java
The hybrid layer blends perfectly into the BRGM geology layer too - with shading:

OpenStreetMap layer for WorldWind Java
See this WWJ Forum thread for more info and discussion.

GeoNames Layer for WorldWind Java

This is the first iteration of a layer that displays city names for the current view, off the GeoNames web service.

GeoNames Layer for WorldWind Java
Download GeoNamesLayer.java, remove the .txt extension and add to the SDK layers.Earth package. Note that you may have to refactor the removeAllRenderables() method call into clearRenderables() for 0.4.1 - see this post comments.

Right now the layer will start showing names below 1500km but doesn't cache anything. It just sends requests to the service and displays the latest results. Sometime, names disappear, then reappear... more work is to be done to smooth things out. The service doesn't let you know whether a location is a large city or a tiny village either.

Still it provides many more world city names then are now displayed in WWJ. GeoNames also offers many kinds of geographic features that could be combined here, including the locations for which there is a geo referenced article in Wikipedia.

Sunday, March 2, 2008

Sunday, February 24, 2008

Procedural Shading for WorldWind Java

Following up on the experimental procedural layer scheme, here is a shading layer that will compute lighting from a fixed south-east light source (morning light in northern hemisphere).



Download ProceduralTiledImageLayer.java (updated Sept 2009) and ProceduralShadingLayer.java. Remove the .txt extension and add to your SDK layers package.

Be sure to read my previous post regarding usage and limitations of this process (availability of elevation data and caching).

Note that light on shaded printed maps usually comes from north because when seen from above, it does give the proper feeling for relief, although it is unnatural in the northern hemisphere where the sun never shines from the north.

This is because our brain is used to understand shadows produced by a light source coming from above - in real life, light almost never comes from below. This is why craters on the Moon or other planets often look like bumps instead of holes - you need to turn the image upside down for your brain to properly understand the lighting.

Saturday, February 23, 2008

3D Models in WWJ

WWJ forum member toolshed has recently posted some basic code to load .obj and .3ds models into the SDK:

WorldWind Java 3D models - ISS
WorldWind Java 3D models - StarWars Fighter
Check this thread for code and discussion.

Monday, February 18, 2008

Procedural Image Layers for WorldWind Java

Here are some experimental classes to produce procedural (computed) tiled image layers. The test layer will create elevation colored tiles on the fly:


Download ProceduralTiledImageLayer.java (updated Sept 2009) and ProceduralTestLayer.java (updated feb. 24). Remove the .txt extension and add to your SDK layers package.

To use the test layer, add an instance to your layer list and set its wwd reference - setWwd(), otherwise it wont be able to produce the tiles (it needs to query the globe elevations).

A couple things to note: once a tile has been created it will be cached and wont be recomputed. That means that if you change the 'formula' that produced those tiles, you must either direct them to a different cache folder, or clear the previous one.

There are many potential applications for procedural tiles. Just with the elevation data, you can produce a great variety of 'elevation colored' maps, you can compute shading, cast shadows or even draw 'line of sight' areas. However, when querying elevations from the globe, you get the 'best available' elevations, meaning that if elevation data has not yet been loaded, the tiles will be produced out of less precise data and would need to be recomputed once better data is available - which it is not doing right now.

Edit feb. 28: to get the best results, i recommend to keep the layer off until you have zoomed onto the area of interest and elevation data has been properly downloaded and then loaded into memory. Tilt the view and look around to force loading on a wider range, then turn on the procedural layer.

Other potential applications include multi resolution rasterized vector data (country borders, roads...). I have to see how this could alleviate some limitations of the actual surface shapes. But that would only work well with static data - not the kind that changes all the time.

See this related WWJ Forum thread.

Tuesday, February 5, 2008

WorldWind Java flat worlds screenshots

Flat worlds are coming together for the next release of the WorldWind Java SDK:

Annotations over a Plate Carrée projection

Terrain profile tool

AWT1Up demo application

GlobalGridAboveSurface example on Plate Carrée

Global cloud image from a remote surface image

Modified sinusoidal projection

I3 Landsat new WMS layer on Mercator projection

Sunday, January 20, 2008

Crosshair Layer for WorldWind Java

It was kind of missing to the SDK... here is a simple crosshair layer and a couple associated bitmaps.


Download WWJ_CrosshairLayer.zip (9k) and add the three files to your SDK source tree.

Monday, January 7, 2008

Control WorldWind by moving your head around

Following in the steps of Johnny Chung Lee from Carnegie Mellon University, WorldWind developer Nigel Tzeng from the John Hopkins Applied Physics Lab, made a very nice demo of a 'desktop virtual reality display' for WorldWind .Net - using a Wii remote:




See this WorldWind forum thread for discussion, and Johnny Lee Wiimote Desktop VR faq on his blog.