Click to Rate and Give Feedback
Related Articles

Silverlight 2 applications are restricted to running inside a browser. However, Silverlight 3 applications can run inside the browser or out. Here we build a social networking app as a standalone Silverlight 3 application.

John Papa

MSDN Magazine June 2009

...

Read more!

Developers often struggle with versioning workflows and their related classes. Matt Milner discusses the core issues related to workflow versioning and provides recommendations for making changes to workflow definitions, activities, and workflow services.

Matthew Milner

MSDN Magazine May 2009

...

Read more!

This month we demonstrate how easy it is to use IronPython to test .NET-based libraries.

James McCaffrey

MSDN Magazine June 2009

...

Read more!

This month we examine forms in the context of AJAX applications and look at various approaches to implementing features such as auto-saving, just-in-time validation, and submission throttling.

Dino Esposito

MSDN Magazine June 2009

...

Read more!

Cobra, a descendant of Python, offers a combined dynamic and statically-typed programming model, built-in unit test facilities, scripting capabilities, and much more. Feel the power here.

Ted Neward

MSDN Magazine June 2009

...

Read more!

Popular Articles

We introduce you to the benefits of building composite applications with the Composite Application Guidance for WPF from Microsoft patterns & practices.

Glenn Block

MSDN Magazine September 2008

...

Read more!

When incorporating the ASP.NET DataGrid control into your Web apps, common operations such as paging, sorting, editing, and deleting data require more effort than you might like to expend. But all that is about to change. The GridView control--the successor to the DataGrid-- extends the DataGrid's functionality it in a number of ways. First, it fully supports data source components and can automatically handle data operations, such as paging, sorting, and editing, as long as its bound data source object supports these capabilities. In addition, ...

Read more!

Here we introduce you to some of the concepts behind the new F# language, which combines elements of functional and object-oriented .NET languages. We then help you get started writing some simple programs.

Ted Neward

MSDN Magazine Launch 2008

...

Read more!

One-time passwords offer solutions to dictionary attacks, phishing, interception, and lots of other security breaches. Here's how it all works.

Dan Griffin

MSDN Magazine May 2008

...

Read more!

The MVP pattern helps you separate your logic and keep your UI layer free of clutter. This month learn how.

Jean-Paul Boodhoo

MSDN Magazine August 2006

...

Read more!

{End Bracket}
Developing the Virtual Earth 3D Control
Duncan Lawler


The Virtual Earth 3D control is a new tool released by Microsoft for visualizing the entire world in three dimensions. Rather than a standalone application, Virtual Earth™ 3D is implemented as a managed control, which allows seamless integration with Web sites or standalone applications. The Microsoft® .NET Framework security model gives users the capability of dynamically loading plug-ins to supply data, but restricting them to execution in a partial-trust environment.
One of the primary goals of the Virtual Earth 3D team's project was to enable developers to build their own applications. The beta release integrates seamlessly with the JScript® API available in the Virtual Earth SDK. Web developers who use the SDK to integrate mapping functions into their Web sites will now be able to show a 3D view with no additional work. For those not doing Web development, there will soon be SDK documentation available on how to embed the control directly in your own Windows® Forms or native application. We will also be documenting and providing samples of how to write and use your own plug-in extensions to change the control model, add your own data to the scene, and more.
To create the Virtual Earth 3D control, the team developed techniques for automatically generating 3D textured models of structures in the real world based on aerial photography with resolutions better than 12 inches. This control allows application developers to create mapping or visualization apps that show real-world locations with a level of detail that gives the user the experience of actually "being there."
Figure 1   (Click the image for a larger view)

As you might expect, the data required to visualize the world at the resolution we wanted was many tens of terabytes in size. So it was immediately obvious that we would not be able to host all this data locally on the user's PC. The data would have to be hosted on a large server and transmitted to the client as needed. Even so, we needed to reduce the file sizes. We started by using standard terrain-rendering techniques to create the surface mesh with high detail in the foreground of the scene and lower detail as you move away from the camera. The fully textured buildings presented a real challenge because of the amount of data that can be visible in a single scene (each of the surface textures generated by the Virtual Earth automated process is unique).
To improve performance, first we created multiple levels of detail for the building models. The source data has a full detail geometry model and a texture map for each building face. Initially, we created a single texture atlas from the source textures for the building. We then took nearby buildings and created a single composite mesh that included all the buildings and a single associated texture atlas. Smaller buildings were removed since they generally won't be visible when the lower-detail level is displayed. We repeated this process with nearby composite meshes collapsed into larger and larger composite meshes. As a result, when the frame is rendered, the lower-detail composite meshes are displayed in the background of the scene instead of the full-detail meshes. Collapsing the textures and models allows Virtual Earth to render them with a single set of calls and greatly improves performance.
Bandwidth required for transmitting this data was the next challenge. To get the best quality for a given texture size, we used the new image formats available in Windows Imaging Components to compress textures for transmission.
Since users often want to visit more than one city, the control continuously monitors the current view and tries to guess where the user will go next. It asynchronously issues priority-ordered requests for the areas that are currently visible or will soon be visible. Also, the control reduces the level of detail it requests based on the connection speed so the user gets a more interactive experience.
Most users will tend to view their own city most often, so caching is a very effective way to improve performance on subsequent visits. Once the data is downloaded, Virtual Earth keeps the textures in system memory to render them to the screen. When the hardware supports it, the textures are converted to a compressed format in video memory. However, this conversion is CPU-intensive, so the team had to carefully throttle this on background threads to avoid causing stutters in the frame rate.
For more information and SDKs, visit the Virtual Earth forums at http://dev.live.com.

Duncan Lawler is Development Manager for the Virtual Earth 3D team. He has been with Microsoft for 10 years, all of it with the Virtual Earth team, and has contributed to MapPoint, Atlas, Streets & Trips, MSN Maps, and Pocket Streets. Contact him at duncal@microsoft.com.

Page view tracker