연구/X3D-Earth
simple nasa worldwind java example
fermi
2008. 8. 29. 08:21
출처 http://i.document.m05.de/?p=313
the sdk is very easy to use but the examples are horrible. three classes with a lot of swing and awt garbage. only 10 lines of code are really needed to get it working in processing.
import gov.nasa.worldwind.*;
import gov.nasa.worldwind.awt.*;
void setup()
{
size(500, 500, JAVA2D);
WorldWindowGLCanvas wwd = new WorldWindowGLCanvas();
wwd.setSize(width, height);
this.add(wwd);
Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
m.setShowWireframeExterior(true);
m.setShowWireframeInterior(false);
m.setShowTessellationBoundingVolumes(false);
wwd.setModel(m);
}
you have to get the worldwind sdk and extract it. create the folders worldwind/library in processing’s libraries folder and copy the file worldwind.jar into it:
libraries/worldwind/library/worldwind.jar
the sdk is very easy to use but the examples are horrible. three classes with a lot of swing and awt garbage. only 10 lines of code are really needed to get it working in processing.
import gov.nasa.worldwind.*;
import gov.nasa.worldwind.awt.*;
void setup()
{
size(500, 500, JAVA2D);
WorldWindowGLCanvas wwd = new WorldWindowGLCanvas();
wwd.setSize(width, height);
this.add(wwd);
Model m = (Model) WorldWind.createConfigurationComponent(AVKey.MODEL_CLASS_NAME);
m.setShowWireframeExterior(true);
m.setShowWireframeInterior(false);
m.setShowTessellationBoundingVolumes(false);
wwd.setModel(m);
}
you have to get the worldwind sdk and extract it. create the folders worldwind/library in processing’s libraries folder and copy the file worldwind.jar into it:
libraries/worldwind/library/worldwind.jar