![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Oct 2007
Posts: 40
![]() |
Hi,
Using the following code we have "Global Clouds" layer on earth but it is on the sea. Code:
public class GlobalClouds extends RenderableLayer {
private static final String GLOBAL_CLOUDS = "http://worldwind25.arc.nasa.gov/GlobalClouds/GlobalClouds.aspx";
public GlobalClouds() {
SurfaceImage si = new SurfaceImage(GLOBAL_CLOUDS, Sector.FULL_SPHERE, this);
setName("Global Clouds");
addRenderable(si);
setPickEnabled(false);
}
}
|
|
|
|
|
|
#2 |
|
Member
Join Date: Oct 2007
Posts: 40
![]() |
It is not possible?
|
|
|
|
|
|
#3 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
Surface image is exactly what it's name imply: an image painted on the globe surface - not up in the air. It actually has no geometry attached to it, just a texture that will go through the surface tile renderer like any other image layer.
I have an experimental subclass of SurfaceImage that does exactly what you need: paint an image on a 'layer' at some altitude (default zero): http://www.alpix.com/3d/worldwin/WWJ...Layer.java.txt The source goes in the render package without the .txt extension. Note that the original cloud image has no alpha channel and will hide entirely the underlying surface. In WW.net, an alpha channel is created every time a new cloud image is downloaded. So you may still have a bit of work to do to get the proper effect. Let us know if you manage to show the cloud layer - with a screenshot maybe ![]() Edit: see this blog post. Last edited by patmurris; 09-14-2008 at 02:43 AM. |
|
|
|
|
|
#4 |
|
Member
Join Date: Oct 2007
Posts: 40
![]() |
Thank you Patrick. It works!
I use this image for cloud layer. It is not perfectly transparent on non-cloudy areas (a little bit greyish) but it is very good. Are there any script somewhere which converts NASA's cloud layer to a perfectly transparent one? I put the layers on 10 km but I cannot see the clouds from the ground. I am not an JOGL expert but I comment out the gl.glEnable(GL.GL_CULL_FACE); in your code and now I can see the clouds from the ground. There may be a method to enable/disable this behavior. And the cloud layer is cut near the horizon because of the frustum settings of wwj and it is not quite possible to solve this issue without a decrease in the performance. Am I right? Thanks again for your work. Edit: Screenshot is attached. Last edited by lembas; 09-17-2008 at 10:21 AM. Reason: Screenshot is attached |
|
|
|
|
|
#5 |
|
Member
Join Date: Oct 2007
Posts: 40
![]() |
Hi,
When I add the GlobalClouds layer, the layer added just before it disappears. Let's say I have only BMNGOneImage layer on earth. When I add GlobalClouds layer, the non-cloudy areas look black. When I have BMNGOneImage and BMNGSurface over it, after adding GlobalClouds layer I can see BMNGOneImage layer. Adding images having transparent sections causes this behavior. Am I right? If so, is there a workaround for this bug? To Patrick: Thanks for the TextureLayer but it has compile time errors on WWJ 0.6. Could you fix it? Or is there a replacement for this layer in WWJ 0.6? My layer is: Code:
public class GlobalClouds extends RenderableLayer {
private static final String GLOBAL_CLOUDS = "http://www.barnabu.co.uk/files/clouds/cloudimage.png";
public GlobalClouds() {
TexturedLayer cloudLayer = new TexturedLayer(GLOBAL_CLOUDS, Sector.FULL_SPHERE, this);
cloudLayer.setElevation(10000);
addRenderable(cloudLayer);
setPickEnabled(false);
setOpacity(1);
}
}
|
|
|
|
|
|
#6 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
![]() |
I'm not sure i understand what 'bug' you refer to. There should be no problem to overlay images with transparent parts.
I updated the TexturedLayer for 0.6 - use the above links. |
|
|
|
|
|
#7 |
|
Member
Join Date: Oct 2007
Posts: 40
![]() |
I was wrong. All works fine when I read the surfaceimage from a local file.
|
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Mar 2010
Location: Russia, Moscow
Posts: 27
![]() |
Why this code works only for local clouds image file?
Why it does not work with internet link? |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Oct 2007
Location: Pau, France
Posts: 116
![]() |
Hello al,
Has this code been integrated in 1.2 ? What is the "official" way to draw a surface JPEG at a given altitude ? I've been greping the source code with no success...setAltitude() ?...setElevation() ?...SurfaceImage...? Help ! Txs |
|
|
|
|
|
#10 |
|
Senior Member
Join Date: Feb 2008
Location: Melbourne, FL, USA
Posts: 675
![]() |
you potentially could use one of the RigidShape extensions(or write your own) and provide a texture to it.
__________________ |