We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
nasa world wind java (Read 8111 times)
nasa world wind java
May 15th, 2007, 9:30pm
 
finally. nasa world wind java (http://worldwind.arc.nasa.gov/java) is out. i was wainting since january to play with it. it’s great that they moved from .net to java in order to get platform independent.

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.
Code:

import processing.opengl.*;
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(http://downloads.sourceforge.net/nasa-exp/worldwind.release.zip), 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
Re: nasa world wind java
Reply #1 - May 23rd, 2007, 2:19pm
 
thanks for the hint. i always thought they'd stick soley to .net.
Re: nasa world wind java
Reply #2 - Aug 9th, 2007, 3:17am
 
Figured I'd bump this as I've started having a look at the code. The examples make sense I think for what they're trying to do, though what is missing -- as is often missing from the modern Java community -- is a barebones example. So this is great.

At least I will say their examples do build easily in both Eclipse and NetBeans, which should be nice for some of their target audience who may not be familiar with JOGL. But Processing integration is, of course, even better.

I wonder if it's possible to dig into the textures directly without the full WW interface? It appears to be. I don't *think* that violates their "not-quite-open" license, but I'm not a lawyer. Wink
Re: nasa world wind java
Reply #3 - Oct 11th, 2007, 6:15am
 
Hey, thanks for posting this code.  I'm having a bit of trouble building it, unfortunately.  The basic drill is that I run the app, the first frame draws out the globe, and then this error is thrown.


Oct 10, 2007 9:01:19 PM gov.nasa.worldwind.AbstractSceneController draw
SEVERE: Exception encountered while repainting
java.lang.NoClassDefFoundError: com/sun/opengl/util/j2d/TextRenderer
at gov.nasa.worldwind.layers.Earth.ScalebarLayer.drawLabel(Unknown Source)
I've tried this on 0124, 0125, 0126 w/ Java 1.5.0_07 (mac os 10.4.x)

Any help would be awesome,
w
Re: nasa world wind java
Reply #4 - Oct 11th, 2007, 3:03pm
 
you cannot integrate awt/swing code into a processing canvas:
http://processing.org/faq.html#java

to do this properly, you should either keep all that canvas stuff offscreen (don't do an add() of the canvas) or you should embed a processing sketch and the worldwindcanvas into a java application--but that you'll have to do with a regular java ide.
Re: nasa world wind java
Reply #5 - Oct 22nd, 2007, 9:56am
 
For anyone, (such as me) encountering this thread at a later date, micheal05's EXACT code works only for the EXACT version of World Wind that he listed in his post, and that version of World Wind DOES NOT work with Java JRE 1.4.  Thus you need:

Processing 0125 or Processing 0129 (these are the two i tested)
This version of World Wind: (http://downloads.sourceforge.net/nasa-exp/worldwind.release.zip)
And JAVA 1.5 (or Java 5.0)

Other newer versions of World Wind will throw the Error Wilson encountered.

Okay now I am off to try and mess with it some more, I love Processing!
Re: nasa world wind java
Reply #6 - Nov 2nd, 2007, 12:50pm
 
that was just a speed hack in order to see if it works in processing. i did not try later versions of wordwind. but the one i used still works in processing 133.

there is a way to get the texture and terrain tiles from worldwind direct. i covered it in my blog:
http://i.document.m05.de/?p=362
Re: nasa world wind java
Reply #7 - Nov 5th, 2007, 2:04pm
 
did someone have success with running the processing-world-wind example as an applet?

Re: nasa world wind java
Reply #8 - Nov 14th, 2007, 7:35pm
 
If you want to try this out with michael05's code just add:

Code:
import gov.nasa.worldwind.avlist.AVKey; 


that seems to work fine for me with the latest SDK.

Any chance somebody would be willing to post some more source code examples of using World Wind inside Processing? Even just a few basic examples would be really helpful
Re: nasa world wind java
Reply #9 - Jan 22nd, 2008, 6:07am
 
If you are using the latest version of processing (well I have 135 Beta) and WorldWind you need to add the JOGL libraries which are in the opengl so you can just add

import processing.opengl.*;

and it works.
Re: nasa world wind java
Reply #10 - Mar 28th, 2008, 9:36pm
 
Interesting... now getting this error, as others had -- on Windows, so I'll have to check other platforms:

Code:
Mar 28, 2008 4:34:21 PM gov.nasa.worldwind.AbstractSceneController draw
SEVERE: Exception encountered while repainting
java.lang.NoClassDefFoundError: com/sun/opengl/util/j2d/TextRenderer

at gov.nasa.worldwind.layers.Earth.ScalebarLayer.drawLabel(Unknown Source)


Using Java 6 (05) + wwj 0.4.1. It's building okay for me in NetBeans (after some effort) and Eclipse, though, so I may try working with it sans-Processing for a bit to better understand it.
Re: nasa world wind java
Reply #11 - Apr 18th, 2008, 7:01am
 
Two things.
First, is it a good idea to embed WorldWind in Processing?  Doesn't processing get sad when you try to embed AWT and swing components?

Also, is anyone else having issues getting this to work in eclipse?  I'm getting the NoClassDef error when running this in the sketch tool, but when I try it in java, WorldWind complains about jogl even though it's in my build path.
Page Index Toggle Pages: 1