CS211 NASA WorldWind Project


In this project you will learn to use NASA WorldWind (http://worldwind.arc.nasa.gov/). The NASA WorldWind project is a free Java software development kit used to create a virtual world, similar to Google Earth. One of the great powers in software devlopment is using other people's code and adding your own functioality. In this project that is what you will do.

We will use NASA WorldWind to create a virtual guided tour program for George Mason University and an interactive user driven tour.

This project will give you experience with Stacks, Listeners, SortedSet (TreeSet), Reading and parsing files.

You will do several steps.


 Step One: Getting Started with NASA WorldWind in Netbeans
1. Download the NASA WorldWind project Java SDK.
2. Unzip the SDK into a directory (we'll assume <<worldwind>> for now)
3. You now need to create a Worldwind library in Netbeans
4. In Netbeans select Tools->Library Manager
5. Select "New library"
    - Library name: Worldwind
    - Library type: Class libraries
6. Click Add Jar/Folder and select:
    - <<worldwind>>/worldwind.jar
    - <<worldwind>>/gluegen-rt.jar
    - <<worldwind>>/jogl.jar
7. Choose the sources tab
    - Click add Jar/Folder
    - Select the directory <<worldwind>>/src
8. Choose the Javadoc tab
    - Click Add ZIP/Folder
    - Select the directory <<worldwind>>/doc
9. Finally click "ok".
You now have a library you can use to access the NASA WorldWind SDK easily in Java.

 Step Two: Create the Netbeans Project
1. Create a new Netbeans project. Name it <<Lastname>>WorldWind (e.g. mine is FleckWorldWind)
2. Right click on the project in Netbeans and select properties
    - Select Run
    - In the VM Options box you need to add: -Djava.library.path=<<worldwind>>
    - Note: You must replace <<worldwind>> with your real path to the worldwind files mine is /users/dfleck/javacode/worldwind
    - Note: We assume you're using Unix. Your library path should not include any spaces (like "My Documents" on Windows).
    - Note: A good windows path looks like this: -Djava.library.path=c:\worldwind
    - Now select Libraries on the left side.
    - Choose "add library"
    - Select the WorldWind library you created in Step One above.
3. Download these files and add them to your project
    - GMUWorldWindDemo.java
    - GMUWorldWindCommands.java
    - WorldWindAppFrame.java
    - GMUPositionListener.java
    - DistanceListener.java
4. Try to compile and run GmuWorldWindDemo.
    - Note: You need an internet connection to download imagery while running!

 Step Three: Create a Guided Virtual Tour Application for George Mason
In this part you will use the power of NASA WorldWind to create a virtual tour of the George Mason campus. The tour will take a set of GPS points (latitude and longtiude). You will read these in from a file and create a Stack of them. Then, pop each value off the Stack and go to that location. Once you are in the correct location display the information about the building you are at. Wait 5 seconds, and move on to the next building by popping the next value from the Stack.

BuildingInfo.txt - Information about each building on the tour (in order that you should tour them), including the GPS coordinates
The building info file has four fields separated by tilde "~".  

Building Name~Description~latitude~longitude

NOTE: A successful implementation of this must use a java.util.Stack data structure!
Hint: To wait 5 seconds you can use this line:             try { Thread.sleep(5000); } catch (Exception e) { } // Wait
Hint: After you go to each building, before going to the next building set your altitude to 1000m and wait 5 seconds.
Hint: After you startup the app frame wait 1 second BEFORE you try to goToGPS.
Hint: You should probably create a Class (mine was called Building.java) to hold the building information (name, desc, lat, long). This should be what goes in your Stack. You then pop it off, go to the lat/long and display the description in the information window using the setInfoText(String txt) method.

 Step Four: Create an interactive Virtual Tour of George Mason
In the interactive tour the user drags the map wherever they want to go. Once the map stops moving you will give them the information about the closest building assuming it is within 1 km. If they are more than 1km from any GMU building, you should give them a message that they are not close to any GMU building.

You need to be able to do a few things to make this all work.


 Step Five: Display the distance to all buildings from your current location (sorted)
In the interface there is a button "Show Distances". If the user presses this button they want to see all the building names and distances from the current location sorted (closest building first).

You need to be able to do a few things to make this all work.

 What to turn in: