Monday, June 4, 2007

Adding single image layers to WWJ

One thing that is missing in the actual WWJ early release 0.2 is an easy mean to apply a single image over the globe. Here is a first atempt at a renderable SurfaceImage class. The screenshot shows the Geo RSS icon pasted over part of Europe.

Download (3k) and follow instructions in the readme.txt to reproduce the above.

One image can be applied to the whole globe too. Here is an example of the code to make a RenderableLayer with one full sphere SurfaceImage :

private RenderableLayer makeImageLayer() {
RenderableLayer layer = new RenderableLayer();
layer.setName("Night Lights SurfaceImage layer");
layer.addRenderable(new SurfaceImage("earthlights1k.jpg",
return layer;

However, this version - and OGL, does only handle images with size being a power of two (16, 32, 64... 1024, 2048...). Images with other sizes will show a black padding - up to the next power of two. And only the lat/lon projection is supported.

See this WWJ forum thread for discussion.

The Earth Lights image comes from James Hastings-Trew Planetary Pixel Emporium. There are also some nice global earth maps at the original Blue Marble page.

No comments: