![]() |
|
|||||||
| Development Help Help for building applications or diagnosing problems with WWJ |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Nov 2008
Posts: 3
|
Hello, I'm going to develop a JAVA application with JDK and NASA World Wind that allows terrain manipulations.
What I would like to do is to allow the user, through some buttons like the ones you can find in all tycoon games, to lower/raise/flatten the terrain in World Wind (see the example image): ![]() Do you have any suggestions how to start? Thank you very much. Last edited by [.::MDT::.]; 11-15-2008 at 06:28 PM. |
|
|
|
|
|
#2 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
|
You can probably achieve something using both SurfaceImage and a custom ElevationModel. See this blog post showing how to override the elevation model.
|
|
|
|
|
|
#3 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
|
Re: comment on my blog post about truncated Earth
This code is intended for the WWJ SDK 0.5, however, it may have dependencies on the not yet published 0.6 that i am not aware of (this has happened before). Please post a console dump of the errors you are getting at compile or runtime. |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Nov 2008
Posts: 3
|
Here it is.
The problem imho is that the method setElevationModel does not exist! Code:
Compiling 1 source file to /NetBeansProjects/WorldWind/build/classes
/tmp/WorldWind/src/examples/TruncatedEarth.java:45: cannot find symbol
symbol : method setElevationModel(examples.TruncatedEarth.AppFrame.TruncatedEarthElevationModel)
location: interface gov.nasa.worldwind.globes.Globe
globe.setElevationModel(new TruncatedEarthElevationModel(sector, elevation));
/tmp/WorldWind/src/examples/TruncatedEarth.java:90: getElevation(gov.nasa.worldwind.geom.Angle,gov.nasa.worldwind.geom.Angle) in examples.TruncatedEarth.AppFrame.TruncatedEarthElevationModel cannot override getElevation(gov.nasa.worldwind.geom.Angle,gov.nasa.worldwind.geom.Angle) in gov.nasa.worldwind.globes.BasicElevationModel; overridden method is final
public double getElevation(Angle latitude, Angle longitude)
/tmp/WorldWind/src/examples/TruncatedEarth.java:107: getElevations(gov.nasa.worldwind.geom.Sector,int) in gov.nasa.worldwind.globes.BasicElevationModel cannot be applied to (gov.nasa.worldwind.geom.Sector,java.util.List<gov.nasa.worldwind.geom.LatLon>,double,double[])
double resolutionAchieved = super.getElevations(sector, latlons, targetResolution, buffer);
3 errors
BUILD FAILED (total time: 0 seconds)
|
|
|
|
|
|
#5 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
|
You are right, that is a new Globe interface method introduced since 0.5.
What you can do then is to create a CustomEarth class similar to Earth with your modified version of ElevationModel that is passed to the EllipsoidalGlobe constructor. To use that custom globe you can either edit the config.worldwind.properties file or set the AVKey.GLOBE_CLASS_NAME in your application before instantiating WW. In the context of an examples.ApplicationTemplate subclass: Code:
public static void main(String[] args)
{
// Adjust configuration values before instantiation
Configuration.setValue(AVKey.GLOBE_CLASS_NAME, CustomEarth.class.getName());
ApplicationTemplate.start("World Wind Custom Globe", AppFrame.class);
}
![]() Last edited by patmurris; 11-20-2008 at 02:48 PM. |
|
|
|
|
|
#6 |
|
Member
Join Date: Mar 2008
Posts: 43
|
after some tweeking I've managed to get get Patrick's TruncatedEarth working. It displays the orange and yellow wedges, but it does not look 3d. What I really would like to do is to raise or lower the oceans level. What would be the best approach to do this? Has anyone done this? Should I wait for 0.6 to come out?
|
|
|
|
|
|
#7 |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
|
Not sure what you mean by raising or lowering the ocean level. Did you try with a sharp vertical exaggeration factor - like 10 or 20?
|
|
|
|
|
|
#8 |
|
Member
Join Date: Mar 2008
Posts: 43
|
what I would like to do is to "flood" the land area by raising the ocean water level, thus covering more land, and vice-versa for lowering the water level. It seems to do with elevation models discussed in this thread, but then again maybe not. How would you approach doing this.
|
|
|
|
|
|
#9 | |
|
WWJ Consultant
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
|
Quote:
http://patmurris.blogspot.com/2008/0...orld-wind.html Note that the terrain geometry and depth buffer precision varies a lot depending how far the eye is from the globe, thus producing a very approximate contour around the flooded area. From a previous such water flooding experiment in WW.net, i can tell it works better with some vertical exaggeration when you are looking at whole continents. |
|
|
|
|
|
|
#10 |
|
Member
Join Date: Mar 2008
Posts: 43
|
thanks for the texturedLayer. I have it working, but for my purpose the "eratic" contours I get when I zoom in is not suitable for what I need. But at the moment there is nothing else. I haven't had time to learn how it all works, but as you mentioned in your blog "The bottom line is that some additional work is to be done..". The pictures of the .Net version are outstanding. I hope one day the java version will be able to do the same.
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 3d terrain import to 3dsmax | Bob Hoggarth | Technical Support | 19 | 01-11-2010 02:12 AM |
| Terrain Viewer doubt | Palani | Development Help | 30 | 05-17-2008 12:30 AM |
| Terrain elevation artifact | bchix | Technical Support | 1 | 03-06-2007 06:13 PM |
| Terrain Mapping of DDS images | MetroGnome | Add-ons & Scripts | 3 | 03-17-2005 03:05 AM |
| how to identify tile with missing terrain info | dpatton | Technical Support | 4 | 03-07-2005 08:19 PM |