World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 11-15-2008, 06:26 PM   #1
[.::MDT::.]
Junior Member
 
Join Date: Nov 2008
Posts: 3
Default Terrain Manipulation

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.
[.::MDT::.] is offline   Reply With Quote
Old 11-15-2008, 07:36 PM   #2
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
Default

You can probably achieve something using both SurfaceImage and a custom ElevationModel. See this blog post showing how to override the elevation model.
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Old 11-16-2008, 02:11 AM   #3
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
Default

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.
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Old 11-20-2008, 02:10 PM   #4
[.::MDT::.]
Junior Member
 
Join Date: Nov 2008
Posts: 3
Default

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)
[.::MDT::.] is offline   Reply With Quote
Old 11-20-2008, 02:44 PM   #5
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
Default

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);
    }
Let me know whether this makes sense
__________________
My World Wind Java Blog & WW.net Plugins page

Last edited by patmurris; 11-20-2008 at 02:48 PM.
patmurris is offline   Reply With Quote
Old 11-22-2008, 12:25 AM   #6
workingDog
Member
 
Join Date: Mar 2008
Posts: 43
Default elevation of oceans

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?
workingDog is offline   Reply With Quote
Old 11-23-2008, 03:37 AM   #7
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
Default

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?
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Old 11-23-2008, 04:17 AM   #8
workingDog
Member
 
Join Date: Mar 2008
Posts: 43
Default

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.
workingDog is offline   Reply With Quote
Old 11-23-2008, 05:40 PM   #9
patmurris
WWJ Consultant
 
patmurris's Avatar
 
Join Date: Jun 2005
Location: Saint-Paul de Vence, Alpes Maritimes, France
Posts: 3,412
Default

Quote:
Originally Posted by workingDog View Post
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.
I've got just what you need:
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.
__________________
My World Wind Java Blog & WW.net Plugins page
patmurris is offline   Reply With Quote
Old 11-26-2008, 11:55 AM   #10
workingDog
Member
 
Join Date: Mar 2008
Posts: 43
Default flooding the globe

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.
workingDog is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 05:17 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.