Skip to content

Commit

Permalink
Patched a few minor issues and added README
Browse files Browse the repository at this point in the history
  • Loading branch information
RossAnderson committed Apr 14, 2012
1 parent e17c7ce commit 2e9497a
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
@@ -1,2 +1,2 @@
UserInterfaceState.xcuserstate
xcuserdata
.DS_Store
4 changes: 3 additions & 1 deletion DRAppDelegate.m
Expand Up @@ -51,11 +51,13 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
database.baseUrlString = @"http://b.tiles.mapbox.com/v3/mapbox.mapbox-streets/{z}/{x}/{y}.png";
database.maxzoom = 17;
break;
/*
case 5:
default:
// Stamen Maps Watercolor - http://maps.stamen.com/watercolor
database.baseUrlString = @"http://tile.stamen.com/watercolor/{z}/{x}/{y}.png";
database.baseUrlString = @"http://a.tile.stamen.com/watercolor/{z}/{x}/{y}.png";
database.maxzoom = 17;
*/
}

self.window.rootViewController = self.viewController;
Expand Down
36 changes: 36 additions & 0 deletions README.md
@@ -0,0 +1,36 @@
EarthView 3D Globe Visualization for iOS
========================================

EarthView is an open-source 3D visualization of the Earth globe for iOS that uses map tiles for imagery and OpenGL ES and GLKit for rendering. I built it for a side-project that may never go anywhere, so I figured it might be educational or useful to other developers.

The project uses a quad-tree to page in map tiles that conform to the Tile Map Service standard (or, the flipped Google equivalent). The level of detail to display is determined by the estimated screen-space error of a given page.

Besides fixing the bugs listen below, I am interested in adding topographical detail to the map to make it truly 3D. I intend to load topo height map data using the same map tile system as the visible content.

Enjoy!

About the Author
----------------

I build advanced airborne 3D imagers at my day job, which leaves me with the creative itch to build something a bit more tactile in my free time. Feel free to contact me at my e-mail (ross.w.anderson@gmail.com) if you have questions, comments, or an interesting business opportunity.

License
-------

The overall license for this project is BSD. TPPropertyAnimation by Michael Tyson is also BSD licensed and is included in the Source folder. Please see the license file for specific rights and restrictions.

Requirements and Dependancies
-----------------------------

This project has no dependencies beyond the iOS 5 SDK. It has been tested to work correctly on an iPad (3rd generation) and iPhone 4.

The example application connects to various map tiles services over the web such as MapBox and OpenSteetMap as defined in DRAppDelegate.m. There is no local data stored with the application, so an Internet connection on your device is required.

Bugs and Limitations
--------------------

- The paging engine still needs a bit of work to more efficiently unload pages.
- The sky box does not display on devices although it works in the simulator.
- No explicit caching is done of map tiles.
- Lighting of the globe, especially when tilted, needs to be improved.
- A hole is displayed at the poles because there is no map tile content here.
2 changes: 0 additions & 2 deletions Source/RASceneGraphController.m
Expand Up @@ -333,14 +333,12 @@ - (void)glkView:(GLKView *)view drawInRect:(CGRect)rect
glClearColor(0.0f, 0.0f, 0.1f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

/*
// render the skybox
glDisable(GL_DEPTH_TEST);
[skybox prepareToDraw];
[skybox draw];
glEnable(GL_DEPTH_TEST);
glClear(GL_DEPTH_BUFFER_BIT);
*/

// run the render visitor
[renderVisitor clear];
Expand Down
9 changes: 9 additions & 0 deletions Source/RATilePager.m
Expand Up @@ -387,8 +387,16 @@ - (void)updateSceneGraph {
[_removePages enumerateObjectsUsingBlock:^(RAPage *page, BOOL *stop) {
[nodes removeChild: page.geometry];
[page releaseGL];

// delete the page data if not a root page
if ( ! [rootPages containsObject:page] ) {
page.image = nil;
page.geometry = nil;
}
}];

// this section would replace the page deletion above, but it doesn't quite work well yet
/*
[_removePages minusSet: rootPages];
NSUInteger totalPages = _insertPages.count + _removePages.count + _activePages.count;
NSUInteger maxPages = 100;
Expand All @@ -413,6 +421,7 @@ - (void)updateSceneGraph {
if ( page.isLeaf ) [page prune];
}];
}
*/

_insertPages = nil;
_removePages = nil;
Expand Down

0 comments on commit 2e9497a

Please sign in to comment.