Printer Friendly Version      Send     
Click to Rate and Give Feedback
Related Articles

The CLR team takes a look inside the System.Globalization namespace to explain how to handle data formats for proper localization and globalization.

Melitta Andersen

MSDN Magazine November 2008

...

Read more!

Choosing the right design pattern for your ASP.NET Web application can help you achieve the separation of concerns between your presentation layer and the layers beneath it.

Dino Esposito

MSDN Magazine December 2008

...

Read more!

Matt Milner takes a look at some of the challenges and techniques related to testing Windows Workflow Foundation activities, workflows, and associated components.

Matt Milner

MSDN Magazine November 2008

...

Read more!

Our security experts present 10 vulnerable pieces of code. Your mission is to find the holes (a.k.a. bad security practices) in the code.

Michael Howard and Bryan Sullivan

MSDN Magazine November 2008

...

Read more!

This article presents an overview of the motivation behind new techniques that decompose problems into independent pieces for optimal use of parallel programming.

David Callahan

MSDN Magazine October 2008

...

Read more!

Popular Articles

A Sidebar gadget is a powerful little too that's surprisingly easy to create. Get in on the fun with Donavon West.

Donavon West

MSDN Magazine August 2007

...

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!

This article presents an overview of the motivation behind new techniques that decompose problems into independent pieces for optimal use of parallel programming.

David Callahan

MSDN Magazine October 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!

Kenny Kerr sings the praises of the new Visual C++ 2008 Feature Pack, which brings modern conveniences to Visual C++.

Kenny Kerr

MSDN Magazine May 2008

...

Read more!

Our Blog

So many factors can affect the performance of a Web page—the distance between server and client, the size of the elements on the page, how the browser loads these elements, available bandwidth. Finding those bottlenecks and identifying the culprits is no easy task.

In the November 2008 issue of MSDN Magazine, Jim Pierson introduces ...

Read more!

Choosing the best alternative is a common task in software development and testing. A group of beta users may need to choose the best user interface from a set of prototypes. Or imagine the members of an open source project voting for a policy.

In the November 2008 issue of MSDN Magazine, Dr. James McCaffrey describes five of the ...

Read more!

Because Windows Workflow Foundation (WF) is based on a runtime that manages the execution of workflows and activities, testing must, in almost all cases, involve the use of the runtime – and this can introduce some interesting challenges.

In the November 2008 issue of MSDN Magazine, Matt Milner presents some techniques for unit testing ...

Read more!

Visual Studio 2008 Team Foundation Server Build (better known as Team Build) is a core feature of Team Foundation Server 2008. Microsoft designed Team Build to be an industrial-strength build automation tool.

In the November 2008 issue of MSDN Magazine, Brian A. Randell introduces you to Team Build 2008 and walks you through the process ...

Read more!

A team project is simply a bucket that stores and partitions all of the artifacts you track and use within a Team Foundation Server (TFS) project.

In the December 2008 issue of MSDN Magazine, Brian A. Randell explains how you can use and customize the MSF Agile and MFS CMMI process templates to get the most out of them for your ...

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